From cdad66161e749fc44ee5d5af080424c4e084d9d4 Mon Sep 17 00:00:00 2001 From: waaake Date: Wed, 15 Jan 2025 09:17:43 +0530 Subject: [PATCH] [controls] SelectionBox: Setting the drag.smoothed property to false when the selection is started Setting the drag.smoothed to false ensures that the target will be moved straight to the current mouse position --- meshroom/ui/qml/Controls/SelectionBox.qml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meshroom/ui/qml/Controls/SelectionBox.qml b/meshroom/ui/qml/Controls/SelectionBox.qml index e7763e84379..6fd59f073ab 100644 --- a/meshroom/ui/qml/Controls/SelectionBox.qml +++ b/meshroom/ui/qml/Controls/SelectionBox.qml @@ -19,6 +19,7 @@ Item { property alias border: selectionBox.border readonly property bool active: mouseArea.drag.target == dragTarget + readonly property int isDragSmoothed: mouseArea.drag.smoothed signal selectionEnded(rect selectionRect, int modifiers) @@ -26,6 +27,7 @@ Item { dragTarget.startPos.x = dragTarget.x = mouse.x; dragTarget.startPos.y = dragTarget.y = mouse.y; dragTarget.modifiers = mouse.modifiers; + mouseArea.drag.smoothed = false; mouseArea.drag.target = dragTarget; } @@ -33,6 +35,7 @@ Item { if (!active) { return; } + mouseArea.drag.smoothed = isDragSmoothed; mouseArea.drag.target = null; const rect = Qt.rect(selectionBox.x, selectionBox.y, selectionBox.width, selectionBox.height) selectionEnded(rect, dragTarget.modifiers);