Rotating an NSView around its center
Rotating an NSView around its center
- Subject: Rotating an NSView around its center
- From: Michael Becker <email@hidden>
- Date: Fri, 11 Mar 2005 15:50:44 +0100
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