From 3c4abee62cf13e68c7cdd9d8195f32a87506b1d6 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Sun, 4 Sep 2016 11:40:08 -0700 Subject: [PATCH] Cancel polygon edit in appropriate places --- src/FlightMap/FlightMap.qml | 20 +++++++++++++++++--- src/MissionEditor/MissionEditor.qml | 4 +++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/FlightMap/FlightMap.qml b/src/FlightMap/FlightMap.qml index 3b72803c4..340f2bf07 100644 --- a/src/FlightMap/FlightMap.qml +++ b/src/FlightMap/FlightMap.qml @@ -221,8 +221,7 @@ Map { var polygonPath = polygonDrawerPolygon.path polygonPath.pop() // get rid of drag coordinate - polygonDrawer._clearPolygon() - polygonDrawer.drawingPolygon = false + _cancelCapturePolygon() polygonDrawer._callbackObject.polygonCaptureFinished(polygonPath) return true } @@ -292,12 +291,27 @@ Map { } function finishAdjustPolygon() { + _cancelAdjustPolygon() + polygonDrawer._callbackObject.polygonAdjustFinished() + } + + /// Cancels an in progress draw or adjust + function cancelPolygonEdit() { + _cancelAdjustPolygon() + _cancelCapturePolygon() + } + + function _cancelAdjustPolygon() { polygonDrawer.adjustingPolygon = false for (var i=0; i