summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@theqtcompany.com>2016-04-14 10:36:23 +0200
committerTimur Pocheptsov <timur.pocheptsov@theqtcompany.com>2016-04-20 12:22:59 +0000
commit6d9a3c0119bfdc9fa7453064e1ffed780c19bcb4 (patch)
tree5b3e90b2de089a38c93d45cb60e314ddc40a5b22
parente75bd17e3dd9dd07d4f2aa53ee9a7eb07ebe4bf8 (diff)
QMacPinchGestureRecognizer - fix totalScaleFactor
Set totalScaleFactor on a pinch gesture (OS X) so that it works the same way as in 'standard' gesture recognizer and corresponds to what we document. [ChangeLog][QtWidgets] : QPinchGesture on OS X now behaves like on other platforms: totalScaleFactor is the magnitude of the pinch and scaleFactor is the delta for the current event. Task-number: QTBUG-48138 Change-Id: I66b9a1df05cbe106b76aed8f15d900bcdd41fdb7 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
-rw-r--r--src/widgets/kernel/qmacgesturerecognizer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/kernel/qmacgesturerecognizer.cpp b/src/widgets/kernel/qmacgesturerecognizer.cpp
index 9f55e23cee..a87d8fdf0b 100644
--- a/src/widgets/kernel/qmacgesturerecognizer.cpp
+++ b/src/widgets/kernel/qmacgesturerecognizer.cpp
@@ -115,7 +115,8 @@ QMacPinchGestureRecognizer::recognize(QGesture *gesture, QObject *obj, QEvent *e
case Qt::ZoomNativeGesture:
g->setLastScaleFactor(g->scaleFactor());
g->setLastRotationAngle(g->rotationAngle());
- g->setScaleFactor(g->scaleFactor() * (1 + ev->value()));
+ g->setScaleFactor(1 + ev->value());
+ g->setTotalScaleFactor(g->totalScaleFactor() * g->scaleFactor());
g->setChangeFlags(QPinchGesture::ScaleFactorChanged);
g->setTotalChangeFlags(g->totalChangeFlags() | g->changeFlags());
g->setHotSpot(ev->screenPos());