Re: Which CA Layer am I dragging over?
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