Commit 0ac1c3810824b43fb8439d72d116e379e01e5030

  • avatar
  • Peter Hutterer <peter.hutterer @wh…t.net> (Committer)
  • Thu Dec 24 00:01:05 CET 2009
  • avatar
  • Ping Cheng <pingc @wa…m.com> (Author)
  • Wed Dec 23 03:06:34 CET 2009
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>
  
726726 {
727727 tmp_coord = *x;
728728 *x = *y;
729 if (!IsTouch(priv))
730 *y = common->wcmMaxY - tmp_coord;
731 else
732 *y = common->wcmMaxTouchY - tmp_coord;
729 *y = priv->maxY - tmp_coord;
733730 }
734731 else if (common->wcmRotate == ROTATE_CCW)
735732 {
736733 tmp_coord = *y;
737734 *y = *x;
738 if (!IsTouch(priv))
739 *x = common->wcmMaxX - tmp_coord;
740 else
741 *y = common->wcmMaxTouchX - tmp_coord;
735 *x = priv->maxX - tmp_coord;
742736 }
743737 else if (common->wcmRotate == ROTATE_HALF)
744738 {
745 if (!IsTouch(priv))
746 {
747 *x = common->wcmMaxX - *x;
748 *y = common->wcmMaxY - *y;
749 }
750 else
751 {
752 *x = common->wcmMaxTouchX - *x;
753 *y = common->wcmMaxTouchY - *y;
754 }
739 *x = priv->maxX - *x;
740 *y = priv->maxY - *y;
755741 }
756742}
757743
19391939 /* rotate all devices at once! else they get misaligned */
19401940 for (tmppriv = common->wcmDevices; tmppriv; tmppriv = tmppriv->next)
19411941 {
1942 oldMaxX = priv->maxX;
1943 oldMaxY = priv->maxY;
1942 oldMaxX = tmppriv->maxX;
1943 oldMaxY = tmppriv->maxY;
19441944
1945 if (oldRotation == ROTATE_CW || oldRotation == ROTATE_CCW)
1945 if (oldRotation == ROTATE_CW || oldRotation == ROTATE_CCW)
19461946 {
1947 priv->maxX = oldMaxY;
1948 priv->maxY = oldMaxX;
1947 tmppriv->maxX = oldMaxY;
1948 tmppriv->maxY = oldMaxX;
19491949 }
19501950
19511951 tmpTopX = tmppriv->topX;