summaryrefslogtreecommitdiffstats
path: root/examples/gestures/imagegestures/imagewidget.cpp
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-11-05 11:46:12 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-11-05 11:54:55 (GMT)
commit75da4b5855c63b41060886c7b8ed7856888e4e35 (patch)
treecd1b55ffb3491fa7647c37949b0f03d14af6759a /examples/gestures/imagegestures/imagewidget.cpp
parent6777135b2cacd3a72a60ff372749837b67762fbe (diff)
downloadQt-75da4b5855c63b41060886c7b8ed7856888e4e35.zip
Qt-75da4b5855c63b41060886c7b8ed7856888e4e35.tar.gz
Qt-75da4b5855c63b41060886c7b8ed7856888e4e35.tar.bz2
Fixed pinching in the imagegestures example.
When the gesture finishes it might not necessery set the ScaleFactorChanged flag. Also fixed the touch-event based pinch gesture. Reviewed-by: trustme
Diffstat (limited to 'examples/gestures/imagegestures/imagewidget.cpp')
-rw-r--r--examples/gestures/imagegestures/imagewidget.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/gestures/imagegestures/imagewidget.cpp b/examples/gestures/imagegestures/imagewidget.cpp
index 80bd6a6..afa0185 100644
--- a/examples/gestures/imagegestures/imagewidget.cpp
+++ b/examples/gestures/imagegestures/imagewidget.cpp
@@ -141,12 +141,11 @@ void ImageWidget::pinchTriggered(QPinchGesture *gesture)
}
if (changeFlags & QPinchGesture::ScaleFactorChanged) {
qreal value = gesture->property("scaleFactor").toReal();
- if (gesture->state() == Qt::GestureFinished) {
- scaleFactor *= currentStepScaleFactor;
- currentStepScaleFactor = 1;
- } else {
- currentStepScaleFactor = value;
- }
+ currentStepScaleFactor = value;
+ }
+ if (gesture->state() == Qt::GestureFinished) {
+ scaleFactor *= currentStepScaleFactor;
+ currentStepScaleFactor = 1;
}
update();
}