Re: Rotating an NSView around its center
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