• 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: Which CA Layer am I dragging over?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Which CA Layer am I dragging over?


  • Subject: Re: Which CA Layer am I dragging over?
  • From: David Duncan <email@hidden>
  • Date: Thu, 28 Jan 2010 12:21:47 -0800

On Jan 28, 2010, at 10:39 AM, K. Darcy Otto wrote:

> Thank you for this; but I'm still having a few problems.  Here's what I have as part of -mouseDragged (where hitLayer is the CA layer that has been identified):
>
> CGRect p,q;
> p = [hitLayer bounds];
> q = [[hitLayer superlayer] convertRect:p fromLayer:hitLayer];
>
> Now, q is in the coordinate system of the superlayer - I'm not sure how to get it into the coordinate system of the view (there is no -convertRect:fromLayer: for the view).  I've tried the NSView methods -convertRect:toView: and -convertRectToBase: without success.


The view's layer shares a coordinate system with the view (this assumes that view.frame.size == view.bounds.size). Therefore, once you've converted to the view's layer's coordinate system, you are in the view's internal (bounds) coordinate system.

When view.frame.size != view.bounds.size this is trickier, but that is an unusual case for layer backing, and I don't think it is your case.
--
David Duncan
Apple DTS Animation and Printing

_______________________________________________

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: 
 >Size of Core Animation Layer (From: K.Darcy Otto <email@hidden>)
 >Re: Size of Core Animation Layer (From: vincent habchi <email@hidden>)
 >Which CA Layer am I dragging over? (From: "K. Darcy Otto" <email@hidden>)
 >Re: Which CA Layer am I dragging over? (From: David Duncan <email@hidden>)
 >Re: Which CA Layer am I dragging over? (From: "K. Darcy Otto" <email@hidden>)

  • Prev by Date: Re: Uncaught exceptions not terminating my app
  • Next by Date: Re: Fuzzy Focus Ring
  • Previous by thread: Re: Which CA Layer am I dragging over?
  • Next by thread: NSKeyValueBindingCreation Leak
  • Index(es):
    • Date
    • Thread