On Apr 29, 2013, at 10:18 AM, Daniele Margutti <m...@danielemargutti.com> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to