[Webkit-unassigned] [Bug 10599] JSMouseEvent needs to expose floating-point-precise mouse coordinates

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Dec 29 21:29:07 PST 2007


------- Comment #2 from eric at webkit.org  2007-12-29 21:29 PDT -------
Mouse events on Mac OS X do in fact provide floating point coordinates, and at
those times the pointing device is in-fact "between pixels".  When you're using
a tablet, you want the physical tablet dimensions to line up with some set of
dimensions on the screen.  The logical dimensions of the devices don't always
match up.  Imagine for example a Cintiq: http://www.wacom.com/cintiq/.  There
touching a point on the screen/tablet is expected to correspond with that point
in the UI, however when you're drawing, the tablet has higher resolution than
the screen and you want that higher resolution to be exposed to your drawing
application.  If the OS just snapped the incoming tablet events to the top-left
corner of every screen pixel (i.e. integer coordinates), then you'd end up with
not as nice of a drawing.

In Mac OS X, you are provided floating point coordinates for every mouse event,
and as an application you are expected to floor() those points to find the
closest pixel (if you care about snapping to pixels).  I don't think we can
expect the same of web apps, so we can't just change the existing screenX,
screenY to be floats.  But we should expose floating point coordinates so web
apps on something like a cintiq (or iphone!) could make an interesting drawing
application with sub-pixel positioning.

Another interesting side-effect of tablet mouse events is that you get *a lot*
more of them than you do with a normal pointing device.  This could also be a
problem for some web apps.  I'm not sure if we do any mouse event throttling in
WebKit currently however.  The iPhone might.

Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the webkit-unassigned mailing list