aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2022-11-16 21:39:31 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2022-11-17 15:58:18 +0100
commita37a75ee0e2be4fb66e582d827642ebdfe5f1f55 (patch)
tree9db27b12f54c36e30bde8d3df7403a9f9a29f01a /src
parent7ea85ac753091253be10a06f502f5c4de4eaa32d (diff)
PinchHandler null target: remember accumulated scale between pinches
This restores behavior from b4d31c9ff5f0c5821ea127c663532d9fc2cae43e which got broken in fc636af3a723ee8b4ee42cf71864ae0df5ca4621. As documented, PinchHandler.scale is the accumulated scale that would be applied to the target item (even if there is no target), whereas activeScale is the scale during one pinch gesture. After the first gesture, these two values are supposed to diverge, even if there is no target; that way you can bind scale to some property, to scale something else in the same way that PinchHandler would normally scale its target. Fixes: QTBUG-108549 Task-number: QTBUG-68941 Task-number: QTBUG-92064 Change-Id: I32ff37e394fd8466128603eddd5697ba1cc1a0ed Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 3046fe153dd2c5679479eb512dcee6bdc80bd1cf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/quick/handlers/qquickpinchhandler.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/handlers/qquickpinchhandler.cpp b/src/quick/handlers/qquickpinchhandler.cpp
index 467bedd3bf..2c8272301f 100644
--- a/src/quick/handlers/qquickpinchhandler.cpp
+++ b/src/quick/handlers/qquickpinchhandler.cpp
@@ -203,8 +203,8 @@ void QQuickPinchHandler::onActiveChanged()
m_startRotation = t->rotation();
m_startPos = t->position();
} else {
- m_startScale = 1;
- m_startRotation = 0;
+ m_startScale = m_accumulatedScale;
+ m_startRotation = 0; // TODO m_accumulatedRotation (QTBUG-94168)
}
qCDebug(lcPinchHandler) << "activated with starting scale" << m_startScale << "rotation" << m_startRotation;
} else {