FROM : I. Savant
DATE : Sat Jul 08 21:23:04 2006
Keith:
If I recall correctly, the pattern's origin is relative to the
window coordinates, not the view on which it is being drawn. I hope
this helps.
--
I.S.
On Jul 8, 2006, at 2:27 PM, Keith Blount wrote:
> 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_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/idiotsavant2005%
> 40gmail.com
>
> This email sent to <email_removed>
DATE : Sat Jul 08 21:23:04 2006
Keith:
If I recall correctly, the pattern's origin is relative to the
window coordinates, not the view on which it is being drawn. I hope
this helps.
--
I.S.
On Jul 8, 2006, at 2:27 PM, Keith Blount wrote:
> 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_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/idiotsavant2005%
> 40gmail.com
>
> This email sent to <email_removed>
| Related mails | Author | Date |
|---|---|---|
| Keith Blount | Jul 8, 20:27 | |
| I. Savant | Jul 8, 21:23 | |
| Keith Blount | Jul 8, 21:45 |






Cocoa mail archive

