From a842c1a4f7e1a3c00504abfe6d267f061758e521 Mon Sep 17 00:00:00 2001 From: Aleksey Kontsevich Date: Mon, 8 Jun 2020 23:15:27 +0300 Subject: [PATCH] Keep vertex selection on vertex remove --- src/MissionManager/QGCMapPolygon.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/MissionManager/QGCMapPolygon.cc b/src/MissionManager/QGCMapPolygon.cc index 26e7cca71..32001b63e 100644 --- a/src/MissionManager/QGCMapPolygon.cc +++ b/src/MissionManager/QGCMapPolygon.cc @@ -311,7 +311,11 @@ void QGCMapPolygon::removeVertex(int vertexIndex) QObject* coordObj = _polygonModel.removeAt(vertexIndex); coordObj->deleteLater(); - selectVertex(-1); + if(vertexIndex == _selectedVertexIndex) { + selectVertex(-1); + } else if (vertexIndex < _selectedVertexIndex) { + selectVertex(_selectedVertexIndex - 1); + } // else do nothing - keep current selected vertex _polygonPath.removeAt(vertexIndex); emit pathChanged(); -- 2.22.0