diff options
| author | Shawn Rutledge <shawn.rutledge@qt.io> | 2022-09-01 07:23:44 +0200 |
|---|---|---|
| committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2022-09-01 22:12:33 +0200 |
| commit | 5cb3ba93da2673b20abae8a544a961b7b57dff45 (patch) | |
| tree | eed37fc826ebe073d9f24fe3493c1a52043b8c0a /src/quick/handlers/qquickpinchhandler.cpp | |
| parent | 5b81451d448d667b500ae6283ded9e59826e72b3 (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.
Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-106110
Change-Id: Ibf8d955e5f1dac517e0a3e9588fb117d83f443a6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/quick/handlers/qquickpinchhandler.cpp')
| -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(); |
