From b09fb97ad8d975227399d355907f768d1ce93623 Mon Sep 17 00:00:00 2001 From: DeepSOIC Date: Wed, 28 Nov 2018 13:53:40 +0300 Subject: [PATCH] Gui: Gesture: fix tilt angle sign --- src/Gui/SoTouchEvents.cpp | 4 ++-- src/Gui/WinNativeGestureRecognizers.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Gui/SoTouchEvents.cpp b/src/Gui/SoTouchEvents.cpp index 2c5d4f5e66..0e1bf608fe 100644 --- a/src/Gui/SoTouchEvents.cpp +++ b/src/Gui/SoTouchEvents.cpp @@ -84,8 +84,8 @@ SoGesturePinchEvent::SoGesturePinchEvent(QPinchGesture* qpinch, QWidget *widget) deltaZoom = qpinch->scaleFactor(); totalZoom = qpinch->totalScaleFactor(); - deltaAngle = unbranchAngle((qpinch->rotationAngle()-qpinch->lastRotationAngle()) / 180.0 * M_PI); - totalAngle = qpinch->totalRotationAngle() / 180 * M_PI; + deltaAngle = -unbranchAngle((qpinch->rotationAngle()-qpinch->lastRotationAngle()) / 180.0 * M_PI); + totalAngle = -qpinch->totalRotationAngle() / 180 * M_PI; state = SbGestureState(qpinch->state()); diff --git a/src/Gui/WinNativeGestureRecognizers.cpp b/src/Gui/WinNativeGestureRecognizers.cpp index e425592e69..8239ead9ea 100644 --- a/src/Gui/WinNativeGestureRecognizers.cpp +++ b/src/Gui/WinNativeGestureRecognizers.cpp @@ -129,7 +129,7 @@ QGestureRecognizer::Result WinNativeGestureRecognizerPinch::recognize(QGesture * } double ang = 0.0; if (bRotate) - ang=GID_ROTATE_ANGLE_FROM_ARGUMENT(LOWORD(ev->argument)) / M_PI * 180.0; + ang = -GID_ROTATE_ANGLE_FROM_ARGUMENT(LOWORD(ev->argument)) / M_PI * 180.0; if (q->state() == Qt::NoGesture) { //start of a new gesture, prefill stuff //d->isNewSequence = true;