Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSView relative CGPattern



Hello,

I am trying to use Core Graphics calls from within a
COCOA application to draw in an NSView.

I have been using the CGPattern calls to create and
draw a pattern in the view following the apple
documentation.

However, when the window in which the view is located
resizes, the pattern moves as if it screen relative,
while all the other CG content drawn on top of the
pattern moves as you would expect - relative to the
window.

This seems very strange, but also occurs in the only
other example of using NSPattern I could find:

http://lists.apple.com/archives/carbon-development/2003/Sep/msg00179.html

My draw method to make the referenced code work is as
follows:

- (void)drawRect:(NSRect)rect {

	CGContextRef myContext = [[NSGraphicsContext
currentContext]graphicsPort];

	drawPatternInStrokedCircle(myContext, *(CGRect*)
&rect);


}



If you run this (on Tiger 10.4.1 in my case) and
resize the window which contains the view, the stars
move out of sync with the circle.


The documentation seems to make no reference to this
sort of behaviour.

Any light you could shed on this would be most
welcome!

Many Thanks


__________________________________________________
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.
Quartz-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartz-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.