• 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 NSView around its center
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rotating an NSView around its center


  • Subject: Re: Rotating an NSView around its center
  • From: "Mike R. Manzano" <email@hidden>
  • Date: Fri, 11 Mar 2005 08:45:28 -0800

How about using an NSAffineTransform?


On Mar 11, 2005, at 6:50 AM, Michael Becker wrote:

Hello!

I am trying to rotate a custom NSView around its center point. Imagine something like the Sketch Example program. I have a small custom view on my "canvas" and want to rotate it around its origin. Doing that with NSBezierPaths is easy, just translating to the coordinate origin, rotating, and translating back.

But I cannot seem to do this with an NSView. -setFrameRotation: is rotating around the frame's origin (so changing the frame's origin won't make any difference). Is there any way I can achieve the wanted behavior? I could live with calculations to relocate the frame's origin after rotating, but I guess that will have some pretty ugly trigonometric math involved :-)

Regards,
Michael

_______________________________________________
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

_______________________________________________ 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: 
 >Rotating an NSView around its center (From: Michael Becker <email@hidden>)

  • Prev by Date: Re: Is Mac Mini capable to develop cocoa app?
  • Next by Date: Dynamic inspectors
  • Previous by thread: Rotating an NSView around its center
  • Next by thread: Is Mac Mini capable to develop cocoa app?
  • Index(es):
    • Date
    • Thread