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>
bb10
Timur Pocheptsov 2016-04-14 10:36:23 +02:00
parent e75bd17e3d
commit 6d9a3c0119
1 changed files with 2 additions and 1 deletions

View File

@ -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());