Commit f11819da authored by DonLakeFlyer's avatar DonLakeFlyer

Fix polygon center updates

parent 8a23979e
...@@ -44,7 +44,7 @@ void QGCMapPolygon::_init(void) ...@@ -44,7 +44,7 @@ void QGCMapPolygon::_init(void)
{ {
connect(&_polygonModel, &QmlObjectListModel::dirtyChanged, this, &QGCMapPolygon::_polygonModelDirtyChanged); connect(&_polygonModel, &QmlObjectListModel::dirtyChanged, this, &QGCMapPolygon::_polygonModelDirtyChanged);
connect(&_polygonModel, &QmlObjectListModel::countChanged, this, &QGCMapPolygon::_polygonModelCountChanged); 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) const QGCMapPolygon& QGCMapPolygon::operator=(const QGCMapPolygon& other)
...@@ -89,13 +89,7 @@ void QGCMapPolygon::adjustVertex(int vertexIndex, const QGeoCoordinate coordinat ...@@ -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 // When dragging center we don't signal path changed until add vertices are updated
emit pathChanged(); emit pathChanged();
} }
_polygonModel.value<QGCQGeoCoordinate*>(vertexIndex)->setCoordinate(coordinate); _polygonModel.value<QGCQGeoCoordinate*>(vertexIndex)->setCoordinate(coordinate);
if (!_ignoreCenterUpdates) {
_updateCenter();
}
setDirty(true); setDirty(true);
} }
...@@ -284,8 +278,6 @@ void QGCMapPolygon::removeVertex(int vertexIndex) ...@@ -284,8 +278,6 @@ void QGCMapPolygon::removeVertex(int vertexIndex)
_polygonPath.removeAt(vertexIndex); _polygonPath.removeAt(vertexIndex);
emit pathChanged(); emit pathChanged();
_updateCenter();
} }
void QGCMapPolygon::_polygonModelCountChanged(int count) void QGCMapPolygon::_polygonModelCountChanged(int count)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment