• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: setPatternPhase: woes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setPatternPhase: woes


  • Subject: Re: setPatternPhase: woes
  • From: "I. Savant" <email@hidden>
  • Date: Sat, 8 Jul 2006 15:23:04 -0400

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@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com


This email sent to email@hidden

_______________________________________________ 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
References: 
 >setPatternPhase: woes (From: Keith Blount <email@hidden>)

  • Prev by Date: setPatternPhase: woes
  • Next by Date: NSMatrix disappears
  • Previous by thread: setPatternPhase: woes
  • Next by thread: Re: setPatternPhase: woes
  • Index(es):
    • Date
    • Thread