diff --git a/src/FlightMap/MapItems/MissionItemIndicatorDrag.qml b/src/FlightMap/MapItems/MissionItemIndicatorDrag.qml index 02978635c410a0b397a100dd575d5e5d4089e56f..7b9c4a12b31f3b8bf347e1bac7033eed9794aad0 100644 --- a/src/FlightMap/MapItems/MissionItemIndicatorDrag.qml +++ b/src/FlightMap/MapItems/MissionItemIndicatorDrag.qml @@ -17,10 +17,10 @@ import QGroundControl.Controls 1.0 /// Use to drag a MissionItemIndicator Rectangle { id: itemDragger - x: itemIndicator.x - _touchMarginHorizontal - y: itemIndicator.y - _touchMarginVertical - width: itemIndicator.width + (_touchMarginHorizontal * 2) - height: itemIndicator.height + (_touchMarginVertical * 2) + x: _itemIndicatorX - _touchMarginHorizontal + y: _itemIndicatorY - _touchMarginVertical + width: _itemIndicatorWidth + (_touchMarginHorizontal * 2) + height: _itemIndicatorHeight + (_touchMarginVertical * 2) color: "transparent" z: QGroundControl.zOrderMapItems + 1 // Above item icons @@ -34,11 +34,15 @@ Rectangle { property bool _preventCoordinateBindingLoop: false + property real _itemIndicatorX: itemIndicator ? itemIndicator.x : 0 + property real _itemIndicatorY: itemIndicator ? itemIndicator.y : 0 + property real _itemIndicatorWidth: itemIndicator ? itemIndicator.width : 0 + property real _itemIndicatorHeight: itemIndicator ? itemIndicator.height : 0 property bool _mobile: ScreenTools.isMobile - property real _touchWidth: Math.max(itemIndicator.width, ScreenTools.minTouchPixels) - property real _touchHeight: Math.max(itemIndicator.height, ScreenTools.minTouchPixels) - property real _touchMarginHorizontal: _mobile ? (_touchWidth - itemIndicator.width) / 2 : 0 - property real _touchMarginVertical: _mobile ? (_touchHeight - itemIndicator.height) / 2 : 0 + property real _touchWidth: Math.max(_itemIndicatorWidth, ScreenTools.minTouchPixels) + property real _touchHeight: Math.max(_itemIndicatorHeight, ScreenTools.minTouchPixels) + property real _touchMarginHorizontal: _mobile ? (_touchWidth - _itemIndicatorWidth) / 2 : 0 + property real _touchMarginVertical: _mobile ? (_touchHeight - _itemIndicatorHeight) / 2 : 0 property bool _dragStartSignalled: false onXChanged: liveDrag()