summaryrefslogtreecommitdiff
path: root/src/imports
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2016-11-14 18:38:36 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2016-11-15 12:48:15 +0000
commit44cc951b5e77a1c56a2b0d71815ea92a67aee49e (patch)
treeef1f3d8887ca7c3faed3e4a2d30ab0b3a3dee5b2 /src/imports
parent05c6863297249784b1775d78ccd831900b5c44c9 (diff)
downloadqtlocation-44cc951b5e77a1c56a2b0d71815ea92a67aee49e.tar.gz
Do not update geoLeftBound in Declarative Polygon updateSourcePoints
The left bound of map items is now precomputed when the data is set (setPath/addCoordinate/etc.). Updating the left bound of a polyline or polygon every time that the source points have to be updated (that is projected to screen) is therefore to be avoided. Change-Id: Id3e25477ea022943abcc32649885eaf89f2e0794 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/location/qdeclarativepolygonmapitem.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/imports/location/qdeclarativepolygonmapitem.cpp b/src/imports/location/qdeclarativepolygonmapitem.cpp
index a42892b7..50dce35f 100644
--- a/src/imports/location/qdeclarativepolygonmapitem.cpp
+++ b/src/imports/location/qdeclarativepolygonmapitem.cpp
@@ -150,8 +150,6 @@ void QGeoMapPolygonGeometry::updateSourcePoints(const QGeoMap &map,
if (!sourceDirty_)
return;
- double minX = -1.0;
-
// build the actual path
QDoubleVector2D origin;
QDoubleVector2D lastPoint;
@@ -182,13 +180,10 @@ void QGeoMapPolygonGeometry::updateSourcePoints(const QGeoMap &map,
if (i == 0) {
origin = point;
- minX = point.x();
srcOrigin_ = coord;
srcPath_.moveTo(point.toPointF() - origin.toPointF());
lastPoint = point;
} else {
- if (point.x() <= minX)
- minX = point.x();
const QDoubleVector2D diff = (point - lastPoint);
if (diff.x() * diff.x() + diff.y() * diff.y() >= 3.0) {
srcPath_.lineTo(point.toPointF() - origin.toPointF());
@@ -203,7 +198,6 @@ void QGeoMapPolygonGeometry::updateSourcePoints(const QGeoMap &map,
srcPath_ = srcPath_.simplified();
sourceBounds_ = srcPath_.boundingRect();
- geoLeftBound_ = map.itemPositionToCoordinate(QDoubleVector2D(minX, 0), false);
}
/*!