diff --git a/src/MissionManager/QGCMapPolygon.cc b/src/MissionManager/QGCMapPolygon.cc index 26e7cca71be1a064b603846edbadac879591d277..32001b63e3f1ab7e88e0821499604c2dce70c308 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();