diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/gestures/imageviewer/imagewidget.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/gestures/imageviewer/imagewidget.cpp b/examples/gestures/imageviewer/imagewidget.cpp index 7dbd084..c71c461 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->whatChanged() & QPinchGesture::RotationAngleChanged) + rotationAngle += pg->rotationAngle() - pg->lastRotationAngle(); + if (pg->whatChanged() & QPinchGesture::ScaleFactorChanged) + scaleFactor += pg->scaleFactor() - pg->lastScaleFactor(); update(); } |