Last parameter is the axis maximum, not the axis size. Thus, width - 1.

Signed-off-by: Peter Hutterer <[email protected]>
---
 dix/getevents.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dix/getevents.c b/dix/getevents.c
index c5284eb..0ffc61a 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -972,25 +972,25 @@ positionSprite(DeviceIntPtr dev, int mode, ValuatorMask 
*mask,
      */
     if (tmpx != *screenx)
         *devx = rescaleValuatorAxis(*screenx, NULL, dev->valuator->axes + 0,
-                                    screenInfo.x, screenInfo.width);
+                                    screenInfo.x, screenInfo.width - 1);
 
     if (tmpy != *screeny)
         *devy = rescaleValuatorAxis(*screeny, NULL, dev->valuator->axes + 1,
-                                    screenInfo.y, screenInfo.height);
+                                    screenInfo.y, screenInfo.height - 1);
 
     /* Recalculate the per-screen device coordinates */
     if (valuator_mask_isset(mask, 0)) {
         double x;
 
         x = rescaleValuatorAxis(*screenx - scr->x, NULL,
-                                dev->valuator->axes + 0, 0, scr->width);
+                                dev->valuator->axes + 0, 0, scr->width - 1);
         valuator_mask_set_double(mask, 0, x);
     }
     if (valuator_mask_isset(mask, 1)) {
         double y;
 
         y = rescaleValuatorAxis(*screeny - scr->y, NULL,
-                                dev->valuator->axes + 1, 0, scr->height);
+                                dev->valuator->axes + 1, 0, scr->height - 1);
         valuator_mask_set_double(mask, 1, y);
     }
 
-- 
1.8.1.4

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to