diff options
author | Peter Hutterer <peter.hutterer@redhat.com> | 2008-09-28 21:47:21 +0930 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@redhat.com> | 2008-10-03 15:27:07 +0930 |
commit | 93ef72fa26b27cf90bf5c64ec19ac295a113aaae (patch) | |
tree | bd4f14ceab97e225b0879cf943c78480eacf111b /dix/getevents.c | |
parent | 5ef5e89f0e4b9b8820093e072430e295efce32fa (diff) |
dix: don't lose subpixel precision when scaling.
Only scale x/y back from screen range if we have crossed screen, otherwise
leave it as it is.
Diffstat (limited to 'dix/getevents.c')
-rw-r--r-- | dix/getevents.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/dix/getevents.c b/dix/getevents.c index 166ab4e7d..f2086e8d6 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -919,17 +919,22 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, master->last.valuators[1] = pDev->last.valuators[1]; } + /* Crossed screen? Scale back to device coordiantes */ if(cx != pDev->last.valuators[0]) + { + scr = miPointerGetScreen(pDev); + x = rescaleValuatorAxis(pDev->last.valuators[0], NULL, + pDev->valuator->axes + 0, scr->width); cx = pDev->last.valuators[0]; + } if(cy != pDev->last.valuators[1]) + { + scr = miPointerGetScreen(pDev); cy = pDev->last.valuators[1]; + y = rescaleValuatorAxis(pDev->last.valuators[1], NULL, + pDev->valuator->axes + 1, scr->height); + } - /* scale x/y back to device coordinates */ - scr = miPointerGetScreen(pDev); - x = rescaleValuatorAxis(pDev->last.valuators[0], NULL, - pDev->valuator->axes + 0, scr->width); - y = rescaleValuatorAxis(pDev->last.valuators[1], NULL, - pDev->valuator->axes + 1, scr->height); updateMotionHistory(pDev, ms, first_valuator, num_valuators, &pDev->last.valuators[first_valuator]); @@ -938,7 +943,6 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, &pDev->last.valuators[first_valuator]); /* Update the valuators with the true value sent to the client*/ - /* FIXME: we lose subpixel precision here. */ if(v0) *v0 = x; if(v1) *v1 = y; |