diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2022-09-01 07:23:44 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-09-02 00:40:29 +0000 |
commit | 9e2705e0271bc3f39ca6c9f572e6061d5ac2c2ae (patch) | |
tree | 34a5aa798d852cb549b6209115fa7157ca51458c /src | |
parent | 3c0ab1326ec50a636cc442e788e79042edda9c51 (diff) |
PinchHandler: Enforce min/max scale limits with native gestures
So far the qBound() using m_minimumScale and m_maximumScale was only
applied for normal pointer events: there were no limits when using a
touchpad that sends native gestures.
Fixes: QTBUG-106110
Change-Id: Ibf8d955e5f1dac517e0a3e9588fb117d83f443a6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 5cb3ba93da2673b20abae8a544a961b7b57dff45)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/handlers/qquickpinchhandler.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quick/handlers/qquickpinchhandler.cpp b/src/quick/handlers/qquickpinchhandler.cpp index 1ac08d5354..467bedd3bf 100644 --- a/src/quick/handlers/qquickpinchhandler.cpp +++ b/src/quick/handlers/qquickpinchhandler.cpp @@ -236,6 +236,7 @@ void QQuickPinchHandler::handlePointerEventImpl(QPointerEvent *event) return; case Qt::ZoomNativeGesture: m_activeScale *= 1 + gesture->value(); + m_activeScale = qBound(m_minimumScale, m_activeScale, m_maximumScale); break; case Qt::RotateNativeGesture: m_activeRotation += gesture->value(); |