summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2014-07-28 14:14:38 +0200
committerShawn Rutledge <shawn.rutledge@digia.com>2014-07-28 16:37:31 +0200
commit67410cd644b76354ba17e9541903cdefa84fc85c (patch)
treeae58a59b39f45e32dc6539ccab199001b699a158 /src/plugins
parenta5578d216a37b04cd792bc470f5de86e95f1dc41 (diff)
Windows: correct tablet stylus rotation to range -180..180 degrees
When the user holds the Wacom Art Pen straight, rotation is zero; when turning it counter-clockwise, it should have a negative angle, whereas the driver sends a positive angle multiplied by 10; when turning it clockwise it should have a positive angle up to 180, whereas the driver sends 360 * 10 going downwards towards 180 * 10. These corrections make the angle reading the same between Linux and Windows. Task-number: QTBUG-39570 Change-Id: I9f18ef6629bffa849c8d65cba02d42b21469cebc Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/windows/qwindowstabletsupport.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
index 8ceab02311..164fc12743 100644
--- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp
+++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
@@ -465,7 +465,9 @@ bool QWindowsTabletSupport::translateTabletPacketEvent()
const double degY = atan(cos(radAzim) / tanAlt);
tiltX = int(degX * (180 / M_PI));
tiltY = int(-degY * (180 / M_PI));
- rotation = packet.pkOrientation.orTwist;
+ rotation = 360.0 - (packet.pkOrientation.orTwist / 10.0);
+ if (rotation > 180.0)
+ rotation -= 360.0;
}
if (QWindowsContext::verbose > 1) {