setPatternPhase: woes
setPatternPhase: woes
- Subject: setPatternPhase: woes
- From: Keith Blount <email@hidden>
- Date: Sat, 8 Jul 2006 11:27:02 -0700 (PDT)
Hello,
I have a flipped custom view which has a background
pattern image. Because I want the image to be tiled
from the top-left instead of the bottom left (which
doesn't look right for this particular view), I am
using NSGraphicsContext's -setPatternPhase: method to
ensure the pattern origin is at the top left. This is
what my code for this looks like (contained within
-drawRect:):
[[NSGraphicsContext currentContext]
setPatternPhase:NSMakePoint(0,[self
frame].size.height)];
[[NSColor colorWithPatternImage:patternImg] set];
[NSBezierPath fillRect:rect];
This works absolutely fine when I have one such view
being automatically sized by the window being resized.
However, when the view is contained within a
horizontal split view and is at the top, if the user
drags the splitter bar around to change the size of
the view, the pattern's origin seems to move in the
opposite direction of the splitter... Very strange. I
am guessing that my -setPatternPhase: call is not
sophisticated enough.
Can anyone spot what I need to do to fix this?j
Many thanks in advance.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden