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

Loading…
Cancel
Save