Skip navigation.
 
mlRe: override drawRect
FROM : Ricky Sharp
DATE : Thu Nov 18 21:02:31 2004

On Thursday, November 18, 2004, at 01:51PM, <<email_removed>> wrote:

>Is it possible to override an NSView's ( or any of its subclasses)
>"drawRect:" method so that i can flip the coordinate system before its
>called? I want the graphicsContext to  have a coordinate system much
>like that of a QuickDraw CGrafPtr.


It's probably not a good idea to do this.  But if you have to, you can provide an implementation of isFlipped in your NSView subclasses that returns YES.  Keep in mind though that you'll end up playing around with the CTM when it comes time to draw text.

Personally, I just work with whatever coordinate system is provided to me.  I ask the view (or image) if it's flipped and do the right thing when drawing.

--
Rick Sharp
Instant Interactive(tm)

Related mailsAuthorDate
mloverride drawRect alex Nov 18, 20:50
mlRe: override drawRect Paolo Costabel Nov 18, 20:58
mlRe: override drawRect Ricky Sharp Nov 18, 21:02
mlRe: override drawRect John C. Randolph Nov 19, 00:02
mlRe: override drawRect Wade Tregaskis Nov 19, 10:00