• 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: Markus Spoettl <email@hidden>
  • Date: Thu, 23 Feb 2012 12:00:13 +0100

Hello,

On 28.11.11 15:40, Richard Somers wrote:
>> 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.
>
> Using floor, ceil, or round on the returned value does not work because the value can be off by as much as +-1.0.

Little late into this but I'm curious, did you manage to come up with a solution for the issue (I just ran into the same issue)?

As an illustration for the list, I have logged coordinates of a mouse move and a subsequent mouse down event that followed the move event:

mouseMovedToPoint:NSPoint: {217.15625, 343.3984375}
mouseDownAtPoint:NSPoint: {217, 344}

So it can happen that the hit-tests in -mouseMoved: and -mouseDown: return different objects in my view's object tree (which happens surprisingly often, btw.).

Anyone know how the system works out the integral coordinates?

Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________

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


  • Prev by Date: Re: Can't create window context…crash
  • Next by Date: Re: AXUIElementPostKeyboardEvent - not sending key presses to Safari/TextEdit in Lion
  • Previous by thread: Re: ImageCapture + ImageKit problem...
  • Next by thread: Re: NSView mouseDown truncated coordinates
  • Index(es):
    • Date
    • Thread