summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPing Cheng <pingc@wacom.com>2009-12-22 18:06:34 -0800
committerPeter Hutterer <peter.hutterer@who-t.net>2009-12-24 09:01:05 +1000
commit0ac1c3810824b43fb8439d72d116e379e01e5030 (patch)
tree3c19e950fa423f3f9d933fb2ed74da63826b84f0
parent82408de786df12efa1f5f0ec9d0f5754f9c61bf7 (diff)
downloadxf86-input-wacom-0ac1c3810824b43fb8439d72d116e379e01e5030.tar.gz
Fix a tablet rotation bug.
Caused by the misuse of maximum X and Y. Signed-off-by: Ping Cheng <pinglinux@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/wcmCommon.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/src/wcmCommon.c b/src/wcmCommon.c
index 96efcba..173ee53 100644
--- a/src/wcmCommon.c
+++ b/src/wcmCommon.c
@@ -726,32 +726,18 @@ void wcmRotateCoordinates(LocalDevicePtr local, int* x, int* y)
{
tmp_coord = *x;
*x = *y;
- if (!IsTouch(priv))
- *y = common->wcmMaxY - tmp_coord;
- else
- *y = common->wcmMaxTouchY - tmp_coord;
+ *y = priv->maxY - tmp_coord;
}
else if (common->wcmRotate == ROTATE_CCW)
{
tmp_coord = *y;
*y = *x;
- if (!IsTouch(priv))
- *x = common->wcmMaxX - tmp_coord;
- else
- *y = common->wcmMaxTouchX - tmp_coord;
+ *x = priv->maxX - tmp_coord;
}
else if (common->wcmRotate == ROTATE_HALF)
{
- if (!IsTouch(priv))
- {
- *x = common->wcmMaxX - *x;
- *y = common->wcmMaxY - *y;
- }
- else
- {
- *x = common->wcmMaxTouchX - *x;
- *y = common->wcmMaxTouchY - *y;
- }
+ *x = priv->maxX - *x;
+ *y = priv->maxY - *y;
}
}
@@ -1953,13 +1939,13 @@ void xf86WcmRotateTablet(LocalDevicePtr local, int value)
/* rotate all devices at once! else they get misaligned */
for (tmppriv = common->wcmDevices; tmppriv; tmppriv = tmppriv->next)
{
- oldMaxX = priv->maxX;
- oldMaxY = priv->maxY;
+ oldMaxX = tmppriv->maxX;
+ oldMaxY = tmppriv->maxY;
- if (oldRotation == ROTATE_CW || oldRotation == ROTATE_CCW)
+ if (oldRotation == ROTATE_CW || oldRotation == ROTATE_CCW)
{
- priv->maxX = oldMaxY;
- priv->maxY = oldMaxX;
+ tmppriv->maxX = oldMaxY;
+ tmppriv->maxY = oldMaxX;
}
tmpTopX = tmppriv->topX;