[PATCH] dix: use the right range in positionSprite
Peter Hutterer
peter.hutterer at who-t.net
Thu Apr 11 23:29:06 PDT 2013
Last parameter is the axis maximum, not the axis size. Thus, width - 1.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
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
More information about the xorg-devel
mailing list