From f11819da25d8b8f9c34fff065fa0f189d9af0891 Mon Sep 17 00:00:00 2001 From: DonLakeFlyer Date: Thu, 28 Sep 2017 18:54:14 -0700 Subject: [PATCH] Fix polygon center updates --- src/MissionManager/QGCMapPolygon.cc | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/MissionManager/QGCMapPolygon.cc b/src/MissionManager/QGCMapPolygon.cc index 5beefa9b1..fddd166a5 100644 --- a/src/MissionManager/QGCMapPolygon.cc +++ b/src/MissionManager/QGCMapPolygon.cc @@ -44,7 +44,7 @@ void QGCMapPolygon::_init(void) { connect(&_polygonModel, &QmlObjectListModel::dirtyChanged, this, &QGCMapPolygon::_polygonModelDirtyChanged); connect(&_polygonModel, &QmlObjectListModel::countChanged, this, &QGCMapPolygon::_polygonModelCountChanged); - connect(&_polygonModel, &QmlObjectListModel::countChanged, this, &QGCMapPolygon::_updateCenter); + connect(this, &QGCMapPolygon::pathChanged, this, &QGCMapPolygon::_updateCenter); } const QGCMapPolygon& QGCMapPolygon::operator=(const QGCMapPolygon& other) @@ -89,13 +89,7 @@ void QGCMapPolygon::adjustVertex(int vertexIndex, const QGeoCoordinate coordinat // When dragging center we don't signal path changed until add vertices are updated emit pathChanged(); } - _polygonModel.value(vertexIndex)->setCoordinate(coordinate); - - if (!_ignoreCenterUpdates) { - _updateCenter(); - } - setDirty(true); } @@ -284,8 +278,6 @@ void QGCMapPolygon::removeVertex(int vertexIndex) _polygonPath.removeAt(vertexIndex); emit pathChanged(); - - _updateCenter(); } void QGCMapPolygon::_polygonModelCountChanged(int count) -- 2.22.0