• 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
Getting the mouse location in a CAlayer's coordinates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Getting the mouse location in a CAlayer's coordinates
      • From: Nathan Vander Wilt <email@hidden>
  • Prev by Date: Re: Saving NSFonts and changedFont: trouble
  • Next by Date: Re: Open-source NSToolbar?
  • Previous by thread: Re: Reformatting percent string to two decimal places
  • Next by thread: Re: Getting the mouse location in a CAlayer's coordinates
  • Index(es):
    • Date
    • Thread