• 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: "John C. Randolph" <email@hidden>
  • Date: Thu, 18 Nov 2004 15:02:58 -0800


On Nov 18, 2004, at 11:50 AM, 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.

Well, overriding -drawRect: is what you'll need to do for any custom drawing in the first place, and the coordinate system of your own view is yours to manipulate as you like for your own convenience.


See the NSView documentation for -isFlipped, -scaleUnitSquareToSize:, -setBoundsRotation:, and other methods that alter the view's coordinate system.

-jcr





John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html


_______________________________________________ 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: USB Control Interface
  • Next by Date: Re: Compiles everything
  • Previous by thread: Re: override drawRect
  • Next by thread: Re: override drawRect
  • Index(es):
    • Date
    • Thread