Browse Source

VirtualJoystick: Fix stick position while screen size changes

Resolve of mavlink#10666, while the QGC window is resizing, both virtual
joysticks are not centered causing dangerous behavior. Now, if the screen
size is changed, both joysticks will be centered while the screen resize
is stopped.
QGC4.4
DieBorr 2 years ago committed by Philipp Borgers
parent
commit
7a658a5fe0
  1. 11
      src/QmlControls/JoystickThumbPad.qml

11
src/QmlControls/JoystickThumbPad.qml

@ -28,11 +28,18 @@ Item { @@ -28,11 +28,18 @@ Item {
QGCMapPalette { id: mapPal }
onWidthChanged: calculateXAxis()
onStickPositionXChanged: calculateXAxis()
onHeightChanged: calculateYAxis()
onStickPositionYChanged: calculateYAxis()
onYAxisPositiveRangeOnlyChanged: calculateYAxis()
onHeightChanged: {
calculateYAxis()
reCenter()
}
onWidthChanged: {
calculateXAxis()
reCenter()
}
//We prevent Joystick to move while the screen is resizing
function calculateXAxis() {
if(!_joyRoot.visible) {

Loading…
Cancel
Save