Browse Source

Fix add/remove of drag area onSpecifiesCoordinateChanged

QGC4.4
DonLakeFlyer 4 years ago committed by Don Gagne
parent
commit
d3c536eeac
  1. 23
      src/PlanView/SimpleItemMapVisual.qml

23
src/PlanView/SimpleItemMapVisual.qml

@ -57,19 +57,25 @@ Item {
} }
function showDragArea() { function showDragArea() {
if (!_dragAreaShowing && _missionItem.specifiesCoordinate) { if (!_dragAreaShowing) {
_dragArea = dragAreaComponent.createObject(map) _dragArea = dragAreaComponent.createObject(map)
_dragAreaShowing = true _dragAreaShowing = true
} }
} }
Component.onCompleted: { function updateDragArea() {
showItemVisuals() if (_missionItem.isCurrentItem && map.planView && _missionItem.specifiesCoordinate) {
if (_missionItem.isCurrentItem && map.planView) {
showDragArea() showDragArea()
} else {
hideDragArea()
} }
} }
Component.onCompleted: {
showItemVisuals()
updateDragArea()
}
Component.onDestruction: { Component.onDestruction: {
hideDragArea() hideDragArea()
hideItemVisuals() hideItemVisuals()
@ -79,13 +85,8 @@ Item {
Connections { Connections {
target: _missionItem target: _missionItem
onIsCurrentItemChanged: { onIsCurrentItemChanged: updateDragArea()
if (_missionItem.isCurrentItem && map.planView) { onSpecifiesCoordinateChanged: updateDragArea()
showDragArea()
} else {
hideDragArea()
}
}
} }
// Control which is used to drag items // Control which is used to drag items

Loading…
Cancel
Save