summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qstandardgestures.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@nokia.com>2010-10-25 21:28:37 (GMT)
committerFrederik Gladhorn <frederik.gladhorn@nokia.com>2010-11-03 16:55:53 (GMT)
commitb37fa034257673a43783a54bb66328c82a0c7ef1 (patch)
tree161ec1a6f78d772bf0cd2d58e1bdc6332232188f /src/gui/kernel/qstandardgestures.cpp
parent4c400ec8e397b4da9898f96c50a702eaa362293d (diff)
downloadQt-b37fa034257673a43783a54bb66328c82a0c7ef1.zip
Qt-b37fa034257673a43783a54bb66328c82a0c7ef1.tar.gz
Qt-b37fa034257673a43783a54bb66328c82a0c7ef1.tar.bz2
The lastCenterPoint should be equal to centerPoint for new gestures.
Reviewed-by: Zeno Albisser
Diffstat (limited to 'src/gui/kernel/qstandardgestures.cpp')
-rw-r--r--src/gui/kernel/qstandardgestures.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp
index 7336c84..48b7ac1 100644
--- a/src/gui/kernel/qstandardgestures.cpp
+++ b/src/gui/kernel/qstandardgestures.cpp
@@ -194,13 +194,15 @@ QGestureRecognizer::Result QPinchGestureRecognizer::recognize(QGesture *state,
d->hotSpot = p1.screenPos();
d->isHotSpotSet = true;
+ QPointF centerPoint = (p1.screenPos() + p2.screenPos()) / 2.0;
if (d->isNewSequence) {
d->startPosition[0] = p1.screenPos();
d->startPosition[1] = p2.screenPos();
+ d->lastCenterPoint = centerPoint;
+ } else {
+ d->lastCenterPoint = d->centerPoint;
}
-
- d->lastCenterPoint = d->centerPoint;
- d->centerPoint = (p1.screenPos() + p2.screenPos()) / 2.0;
+ d->centerPoint = centerPoint;
d->changeFlags |= QPinchGesture::CenterPointChanged;