Re: Event Objects Return 1-Based Y Coordinate Values
Re: Event Objects Return 1-Based Y Coordinate Values
- Subject: Re: Event Objects Return 1-Based Y Coordinate Values
- From: Richard Somers <email@hidden>
- Date: Mon, 27 Jun 2011 13:27:58 -0600
On Jun 27, 2011, at 1:13 PM, Jens Alfke wrote:
> It makes sense to me. Integer coordinates denote the grid lines between pixels, not the pixel centers. Likewise, the hot-spot of the cursor is in between pixels, not in the center of a pixel. In the case of the default arrow cursor, the hot-spot is at the tip of the arrow.
>
> Put that together, and what you get is that if the tip pixel of the arrow cursor is positioned over the bottom pixel of the view, the hot-spot is actually at y=1.0.
>
> This may seem a little unexpected, but I don’t think most programmers ever worry about it. Hit-testing shouldn’t require single-pixel accuracy anyway, so I doubt the user would notice if your calculations were a pixel off.
This seems like a correct interpretation. Thanks for the insight.
--Richard
_______________________________________________
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