diff options
-rw-r--r-- | examples/quick/mousearea/mousearea-wheel-example.qml | 7 | ||||
-rw-r--r-- | src/quick/items/qquickevents.cpp | 5 |
2 files changed, 4 insertions, 8 deletions
diff --git a/examples/quick/mousearea/mousearea-wheel-example.qml b/examples/quick/mousearea/mousearea-wheel-example.qml index ca6518ec4b..861639811c 100644 --- a/examples/quick/mousearea/mousearea-wheel-example.qml +++ b/examples/quick/mousearea/mousearea-wheel-example.qml @@ -64,10 +64,9 @@ Rectangle { anchors.fill: parent onWheel: { if (wheel.modifiers & Qt.ControlModifier) { - if (wheel.angleDelta.y > 0) - parent.scaleFactor += 0.2; - else if (parent.scaleFactor - 0.2 >= 0.2) - parent.scaleFactor -= 0.2; + parent.scaleFactor += 0.2 * wheel.angleDelta.y / 120; + if (parent.scaleFactor < 0) + parent.scaleFactor = 0; } } } diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp index 520b9d46bb..88deefbd9a 100644 --- a/src/quick/items/qquickevents.cpp +++ b/src/quick/items/qquickevents.cpp @@ -352,10 +352,7 @@ Item { MouseArea { onWheel: { if (wheel.modifiers & Qt.ControlModifier) { - if (wheel.angleDelta.y > 0) - zoomIn(); - else - zoomOut(); + adjustZoom(wheel.angleDelta.y / 120); } } } |