• 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: override drawRect
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: override drawRect


  • Subject: Re: override drawRect
  • From: Ricky Sharp <email@hidden>
  • Date: Thu, 18 Nov 2004 14:02:31 -0600

On Thursday, November 18, 2004, at 01:51PM, <email@hidden> 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)

 _______________________________________________
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: 
 >override drawRect (From: email@hidden)

  • Prev by Date: Re: override drawRect
  • Next by Date: Unable to coalesce notifications
  • Previous by thread: Re: override drawRect
  • Next by thread: Re: override drawRect
  • Index(es):
    • Date
    • Thread