Getting the mouse location in a CAlayer's coordinates
Getting the mouse location in a CAlayer's coordinates
- Subject: Getting the mouse location in a CAlayer's coordinates
- From: "douglas a. welton" <email@hidden>
- Date: Tue, 8 Apr 2008 12:15:19 -0400
Hi All,
Would someone provide me a pointer for how to get the mouse location
in the coordinate system of a transformed layer that is underneath the
mouse. I thought I could do something like this:
Mouse_Location = [Target_Layer convertPoint:
NSPointToCGPoint( [NSEvent mouseLocation] ) fromLayer: nil];
using "nil" for the fromLayer because Target_Layer is the view's
"topmost" layer and contains all other sublayers. Unfortunately, the
results I get back are incorrect (no conversion appears to be done)
and when the Target_Layer has a transform (scaling) applied, the
results are very wrong.
I am obviously missing something here. Any suggestions and pointers
would be helpful.
thanks,
douglas
_______________________________________________
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