• 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: NSView mouseDown truncated coordinates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSView mouseDown truncated coordinates


  • Subject: Re: NSView mouseDown truncated coordinates
  • From: Jens Alfke <email@hidden>
  • Date: Sat, 26 Nov 2011 09:37:29 -0800

On Nov 25, 2011, at 5:17 PM, Steven Spencer wrote:

> I'm using a NSTrackingArea in a view to receive mouseMoved events.
> The cursor location in the mouseMoved and mouseDragged events have non-integer coordinates (as expected).
> e.g. x:140.601562 y:128.082031

Weird; I don’t think I’ve seen non-integer mouse coords before. Does your view have a scale transformation on it?

> However, the mouseDown and mouseUp events always produce truncated coordinates.
> e.g. x:140.000000 y:128.000000
> This causes inaccuracy with hit testing between mouseMoved and mouseDown.

You might need to truncate the moved/dragged coords too, then, just for consistency. I don’t think the OS tracks the mouse position at a resolution higher than screen pixels anyway.

—Jens_______________________________________________

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: 
 >NSView mouseDown truncated coordinates (From: Steven Spencer <email@hidden>)

  • Prev by Date: Re: Placing an Image next to a UI element
  • Next by Date: Re: NSView mouseDown truncated coordinates
  • Previous by thread: NSView mouseDown truncated coordinates
  • Next by thread: Re: NSView mouseDown truncated coordinates
  • Index(es):
    • Date
    • Thread