summaryrefslogtreecommitdiffstats
path: root/examples/gestures
diff options
context:
space:
mode:
Diffstat (limited to 'examples/gestures')
-rw-r--r--examples/gestures/imageviewer/imagewidget.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/gestures/imageviewer/imagewidget.cpp b/examples/gestures/imageviewer/imagewidget.cpp
index 7dbd084..a4ea238 100644
--- a/examples/gestures/imageviewer/imagewidget.cpp
+++ b/examples/gestures/imageviewer/imagewidget.cpp
@@ -123,8 +123,10 @@ void ImageWidget::panTriggered()
void ImageWidget::pinchTriggered()
{
QPinchGesture *pg = qobject_cast<QPinchGesture*>(sender());
- rotationAngle += pg->rotationAngle();
- scaleFactor += pg->scaleFactor();
+ if (pg->rotationAngle() != 0.0)
+ rotationAngle += pg->rotationAngle() - pg->lastRotationAngle();
+ if (pg->scaleFactor() != 1.0)
+ scaleFactor += pg->scaleFactor() - pg->lastScaleFactor();
update();
}