• 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
Re: Event Objects Return 1-Based Y Coordinate Values
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Event Objects Return 1-Based Y Coordinate Values (From: Richard Somers <email@hidden>)
 >Re: Event Objects Return 1-Based Y Coordinate Values (From: Raleigh Ledet <email@hidden>)
 >Re: Event Objects Return 1-Based Y Coordinate Values (From: Richard Somers <email@hidden>)
 >Re: Event Objects Return 1-Based Y Coordinate Values (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: -(id)init methods, NSExceptions, and returning nil
  • Next by Date: App Delegate method not being called
  • Previous by thread: Re: Event Objects Return 1-Based Y Coordinate Values
  • Next by thread: Cocoa scripting: targeting an app via its bundle identifier
  • Index(es):
    • Date
    • Thread