Skip to content

Commit 04ee7f8

Browse files
fabien servantcbentejac
authored andcommitted
fix mouse camera controller
1 parent de76f6d commit 04ee7f8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

meshroom/ui/qml/Viewer3D/DefaultCameraController.qml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ Entity {
1414
property real translateSpeed: 75.0
1515
property real tiltSpeed: 500.0
1616
property real panSpeed: 500.0
17-
readonly property bool moving: actionLMB.active
18-
readonly property bool panning: (keyboardHandler._pressed && actionLMB.active && actionShift.active) || actionMMB.active
19-
readonly property bool zooming: keyboardHandler._pressed && actionRMB.active && actionAlt.active
2017
property alias focus: keyboardHandler.focus
2118
readonly property bool pickingActive: actionControl.active && keyboardHandler._pressed
2219
property alias rotationSpeed: trackball.rotationSpeed
@@ -68,7 +65,12 @@ Entity {
6865
const dt = 0.02
6966
var d
7067

71-
if (panning) { // Translate
68+
var moving = mouse.buttons & Qt.LeftButton
69+
var panning = (mouse.buttons & Qt.MiddleButton)
70+
var panningAlt = actionShift.active && (mouse.buttons & Qt.LeftButton)
71+
var zooming = actionAlt.active && (mouse.buttons & Qt.RightButton)
72+
73+
if (panning || panningAlt) { // Translate
7274
d = (root.camera.viewCenter.minus(root.camera.position)).length() * 0.03
7375
var tx = axisMX.value * root.translateSpeed * d
7476
var ty = axisMY.value * root.translateSpeed * d

0 commit comments

Comments
 (0)