Re: What is NSView's anchorPoint/origin/axis for setFrameCenterRotation?
Re: What is NSView's anchorPoint/origin/axis for setFrameCenterRotation?
- Subject: Re: What is NSView's anchorPoint/origin/axis for setFrameCenterRotation?
- From: Eric Wing <email@hidden>
- Date: Fri, 07 Sep 2012 14:38:12 -0700
On 9/6/12, Eric Wing <email@hidden> wrote:
> I want to rotate an NSView around its center. (Example: Imagine me
> rotating a magnetic compass around so the North pointer rotates around
> to the bottom.
>
> I thought setFrameCenterRotation would do this for me. But when I try
> it (10.8), it always rotates about the bottom-left corner, not the
> center. I thought this API was supposed to do it around the center and
> setFrameRotation did the bottom-left corner. (Both do the bottom-left
> for me.)
>
> Am I losing my mind? Can somebody confirm the behavior? I can't tell
> by the Apple docs.
>
> Thanks,
> Eric
> --
> Beginning iPhone Games Development
> http://playcontrol.net/iphonegamebook/
>
To answer my own question, it appears that Auto Layout is breaking the
setFrameCenterRotation behavior. The moment I disable Auto Layout, it
seems to rotate around the center as I would expect.
An aside, I noticed that rotating with the animator has a very strange
animation. Instead of spinning around the center, it seems to
simultaneously translate and rotate which creates a wobbly (seasick)
animation while its rotating. I don't think it is very usable as is
unfortunately.
-Eric
--
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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