Re: Core Animation geometry, layer hosting, and resolution independence
Re: Core Animation geometry, layer hosting, and resolution independence
- Subject: Re: Core Animation geometry, layer hosting, and resolution independence
- From: Jens Alfke <email@hidden>
- Date: Wed, 12 Mar 2008 13:13:29 -0700
On 12 Mar '08, at 12:13 PM, Nathan Vander Wilt wrote:
I want to be able to convert a mouse
coordinate into a point suitable for -hitTest:'ing on
my root layer. I can convert from the mouse
coordinates to the view's coordinates, but then I am
not sure how to proceed.
There doesn't seem to be any API for converting between the
coordinates of a view and its root layer. You could probably do it by
getting the root layer's transform property, and then running the
point in view coordinates through that.
I had been using the convenient assumption that the two coord systems
are identical, which they usually are (but I had never tried changing
the screen resolution, q.v.)
CALayers don't have this bounds/frame distinction
They do, actually. The bounds is the internal view of the coordinate
system, and the frame is the external view.
BUT when I use
Quartz Debug to double the scale factor, GeekGameBoard
breaks, as if mouse movements/locations were halved.
Wow, you're right. I'd never tried that.
it almost seems
that 1 unit always corresponds to 1 pixel. How does
Core Animation's geometry relate to NSView's
resolution independent geometry?
I think you're right about the pixels. That's news to me; I'm stumped.
Hopefully some CA expert can enlighten us.
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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