@@ -14,7 +14,9 @@ Entity {
1414 property real translateSpeed: 75.0
1515 property real tiltSpeed: 500.0
1616 property real panSpeed: 500.0
17- property bool moving: pressed || (actionAlt .active && keyboardHandler ._pressed )
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
1820 property alias focus: keyboardHandler .focus
1921 readonly property bool pickingActive: actionControl .active && keyboardHandler ._pressed
2022 property alias rotationSpeed: trackball .rotationSpeed
@@ -44,15 +46,16 @@ Entity {
4446 sourceDevice: mouseSourceDevice
4547 onPressed: {
4648 _pressed = true ;
47- currentPosition = lastPosition = Qt .point (mouse .x , mouse .y );
49+ currentPosition .x = lastPosition .x = mouse .x ;
50+ currentPosition .y = lastPosition .y = mouse .y ;
4851 mousePressed (mouse);
4952 }
5053 onReleased: {
5154 _pressed = false ;
5255 mouseReleased (mouse);
5356 }
5457 onClicked: mouseClicked (mouse)
55- onPositionChanged: { currentPosition = Qt . point ( mouse .x , mouse .y ) }
58+ onPositionChanged: { currentPosition . x = mouse .x ; currentPosition . y = mouse .y }
5659 onDoubleClicked: mouseDoubleClicked (mouse)
5760 onWheel: {
5861 var d = (root .camera .viewCenter .minus (root .camera .position )).length () * 0.2 ;
@@ -158,19 +161,19 @@ Entity {
158161 components: [
159162 FrameAction {
160163 onTriggered: {
161- if (actionMMB . active || ( actionLMB . active && actionShift . active ) ) { // translate
164+ if (panning ) { // translate
162165 var d = (root .camera .viewCenter .minus (root .camera .position )).length () * 0.03 ;
163166 var tx = axisMX .value * root .translateSpeed * d;
164167 var ty = axisMY .value * root .translateSpeed * d;
165168 root .camera .translate (Qt .vector3d (- tx, - ty, 0 ).times (dt))
166169 return ;
167170 }
168- if (actionLMB . active ){ // trackball rotation
171+ if (moving ){ // trackball rotation
169172 trackball .rotate (mouseHandler .lastPosition , mouseHandler .currentPosition , dt);
170173 mouseHandler .lastPosition = mouseHandler .currentPosition ;
171174 return ;
172175 }
173- if (actionAlt . active && actionRMB . active ) { // zoom with alt + RMD
176+ if (zooming ) { // zoom with alt + RMD
174177 var d = (root .camera .viewCenter .minus (root .camera .position )).length () * 0.1 ;
175178 var tz = axisMX .value * root .translateSpeed * d;
176179 root .camera .translate (Qt .vector3d (0 , 0 , tz).times (dt), Camera .DontTranslateViewCenter )
0 commit comments