• 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: rotating an object around the center of a view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rotating an object around the center of a view


  • Subject: Re: rotating an object around the center of a view
  • From: Shawn Erickson <email@hidden>
  • Date: Sun, 04 Mar 2007 18:02:07 -0800


On Mar 4, 2007, at 4:27 PM, Ken Tozier wrote:


On Mar 4, 2007, at 7:01 PM, Bob Smith wrote:

You do not have to do all the view drawing in the same coordinate system. Also repeatedly transforming the paths you are drawing does not seem like the best approach. Better to save and restore graphics state to draw the bits in different coordinate systems, so your graphics model objects can be static. Your -drawRect would look conceptually like this:

One thing about your method that's not immediately obvious to me is why it's more efficient to apply all these transforms to the entire coordinate system of a view than just rotate a bezier path within the view. It seems like, at least intuitively, that transforming a small part of a view (the hands) would be much more efficient.

The "entire" coordinate system is simply a drawing context with some state information. One aspect of that context is the current transform. The current transform only really does something when you go to draw. It doesn't change what you may have drawn already, etc.


-Shawn
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: rotating an object around the center of a view (From: Erik Buck <email@hidden>)
 >Re: rotating an object around the center of a view (From: Ken Tozier <email@hidden>)
 >Re: rotating an object around the center of a view (From: Bob Smith <email@hidden>)
 >Re: rotating an object around the center of a view (From: Ken Tozier <email@hidden>)

  • Prev by Date: Re: Subclass of NSMutableDictionary hanging
  • Next by Date: Re: fopen() works only in debugger
  • Previous by thread: Re: rotating an object around the center of a view
  • Next by thread: Re: rotating an object around the center of a view
  • Index(es):
    • Date
    • Thread