Re: Rotated CALayer and issues with coordinates (should I convert them manually?)
Re: Rotated CALayer and issues with coordinates (should I convert them manually?)
- Subject: Re: Rotated CALayer and issues with coordinates (should I convert them manually?)
- From: Daniele Margutti <email@hidden>
- Date: Mon, 29 Apr 2013 14:11:03 +0200
On Apr 29, 2013, at 10:18 AM, Daniele Margutti <email@hidden> wrote:
> What am I wong?
Meanwhile I've discovered an interesting thing.
In order to convert coordinates from my baseContainerView to inner hostView I've used
CGPoint locationInHostView = [baseContainerView convertPoint:locationInBaseContainer toView:hostView];
It "uses" NSView geometry to convert coordinates (using convertPoint:toView: of NSView)
Instead of using it I've tried to use baseContainer.layer as source and hostView.layer as destination (so using convertPoint:toLayer: method of CALayer).
So:
CGPoint locationInHostView = [baseContainerView.layer convertPoint:locationInBaseContainer toLayer:hostView.layer];
Using this I can get right coordinates of the rotated CALayer.
Now the question is: geometry can differ between NSView and it's CALayer? CALayer seems to be a separated entity of the NSView so when I try to rotate CALayer while the NSView bounds (?) still at the old original position, CALayer bounds are rotated.
Should I rotate both NSView and CALayer? What kind of problems can this separation implies?
Thanks
_______________________________________________
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