Re: NSView mouseDown truncated coordinates
Re: NSView mouseDown truncated coordinates
- Subject: Re: NSView mouseDown truncated coordinates
- From: Markus Spoettl <email@hidden>
- Date: Thu, 23 Feb 2012 19:27:56 +0100
On 23.02.12 18:53, Quincey Morris wrote:
Anyone know how to work out mouseDown coordinates one can expect to
get when looking at mouseMove coordinates?
I'll ask the stupid question:
How do you know (or, why do you assume) that these two sets of
coordinates represent the same point? Even if the user did a
press-and-hold, a high-resolution input device might detect some
"movement" in the position. (At a sub-pixel level, I guess everyone has
fat, wobbly fingers.)
I'm using a mouse and the cursor doesn't move between -mouseMove: and
-mouseDown: (on screen). If the device would be capable of reporting
sub-pixel movements (which may not be reported by moving the cursor), I
guess it would have done so by sending an additional -mouseMove: event.
If it didn't, I have to assume it didn't notice any movement and
therefore didn't report any.
That (maybe flawed) theory asside, I just know that it didn't move
because as an operator I made sure of it (when hunting a bug like this,
one first assumes operator mistakes, I did too).
Up until now (< Lion), it was guaranteed (well, maybe not that, it just
happened to work that way) that the -moveMoved: location corresponded to
the subsequent -mouseDown: location. That meant that any hover-effects
visualized during -mouseMoved: would have been rendered on objects that
react in some way when the mouse goes down on them.
Of course this can be worked around (maybe by ignoring -mouseDown:
coordinates if deemed sensible in the situation). It just complicates
things by having to remember more state than was necessary before. And
it was a surprise.
--
__________________________________________
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