• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Rotated CALayer and issues with coordinates (should I convert them manually?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Rotated CALayer and issues with coordinates (should I convert them manually?) (From: Daniele Margutti <email@hidden>)
 >Re: Rotated CALayer and issues with coordinates (should I convert them manually?) (From: David Duncan <email@hidden>)
 >Re: Rotated CALayer and issues with coordinates (should I convert them manually?) (From: Daniele Margutti <email@hidden>)

  • Prev by Date: Re: Rotated CALayer and issues with coordinates (should I convert them manually?)
  • Next by Date: Re: Laying out text in NSTextView around a subview
  • Previous by thread: Re: Rotated CALayer and issues with coordinates (should I convert them manually?)
  • Next by thread: Multiple untitled docs are saving to same file
  • Index(es):
    • Date
    • Thread