summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@theqtcompany.com>2016-09-13 16:14:38 +0200
committerPaolo Angelelli <paolo.angelelli@theqtcompany.com>2016-09-19 15:15:02 +0000
commitb33d8c905e5b89a391d465d4bb1210401b3d336b (patch)
tree02acbedc93c86de07d1c9a2649fb274565f37bb5
parent5d0481603414a4584dbfe89aaba48a6135b9e2d8 (diff)
downloadqtlocation-b33d8c905e5b89a391d465d4bb1210401b3d336b.tar.gz
Fix for polylines and polygon rendering wrong at the edge of the map
This patch fixes a bug in rendering (re)created polylines/polygons right at the edge of a map, due to not setting preserve geometry to true on geometry modifying methods (addCoordinate/setPath/etc) Task-number: QTBUG-55964 Change-Id: I94bc86e8c908bc0ab4a949d96094988ed7ea26a7 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
-rw-r--r--src/imports/location/qdeclarativepolygonmapitem.cpp6
-rw-r--r--src/imports/location/qdeclarativepolylinemapitem.cpp5
2 files changed, 11 insertions, 0 deletions
diff --git a/src/imports/location/qdeclarativepolygonmapitem.cpp b/src/imports/location/qdeclarativepolygonmapitem.cpp
index 361c554d..3d981406 100644
--- a/src/imports/location/qdeclarativepolygonmapitem.cpp
+++ b/src/imports/location/qdeclarativepolygonmapitem.cpp
@@ -431,6 +431,8 @@ void QDeclarativePolygonMapItem::setPath(const QJSValue &value)
path_ = pathList;
geoLeftBound_ = QDeclarativePolylineMapItem::getLeftBound(path_, deltaXs_, minX_);
+ geometry_.setPreserveGeometry(true, geoLeftBound_);
+ borderGeometry_.setPreserveGeometry(true, geoLeftBound_);
geometry_.markSourceDirty();
borderGeometry_.markSourceDirty();
polishAndUpdate();
@@ -449,6 +451,8 @@ void QDeclarativePolygonMapItem::addCoordinate(const QGeoCoordinate &coordinate)
{
path_.append(coordinate);
geoLeftBound_ = QDeclarativePolylineMapItem::getLeftBound(path_, deltaXs_, minX_, geoLeftBound_);
+ geometry_.setPreserveGeometry(true, geoLeftBound_);
+ borderGeometry_.setPreserveGeometry(true, geoLeftBound_);
geometry_.markSourceDirty();
borderGeometry_.markSourceDirty();
polishAndUpdate();
@@ -473,6 +477,8 @@ void QDeclarativePolygonMapItem::removeCoordinate(const QGeoCoordinate &coordina
path_.removeAt(index);
geoLeftBound_ = QDeclarativePolylineMapItem::getLeftBound(path_, deltaXs_, minX_);
+ geometry_.setPreserveGeometry(true, geoLeftBound_);
+ borderGeometry_.setPreserveGeometry(true, geoLeftBound_);
geometry_.markSourceDirty();
borderGeometry_.markSourceDirty();
polishAndUpdate();
diff --git a/src/imports/location/qdeclarativepolylinemapitem.cpp b/src/imports/location/qdeclarativepolylinemapitem.cpp
index d10d00a5..e349b287 100644
--- a/src/imports/location/qdeclarativepolylinemapitem.cpp
+++ b/src/imports/location/qdeclarativepolylinemapitem.cpp
@@ -556,6 +556,7 @@ void QDeclarativePolylineMapItem::setPathFromGeoList(const QList<QGeoCoordinate>
path_ = path;
geoLeftBound_ = getLeftBound(path_, deltaXs_, minX_);
+ geometry_.setPreserveGeometry(true, geoLeftBound_);
geometry_.markSourceDirty();
polishAndUpdate();
emit pathChanged();
@@ -586,6 +587,7 @@ void QDeclarativePolylineMapItem::addCoordinate(const QGeoCoordinate &coordinate
{
path_.append(coordinate);
geoLeftBound_ = getLeftBound(path_, deltaXs_, minX_, geoLeftBound_);
+ geometry_.setPreserveGeometry(true, geoLeftBound_);
geometry_.markSourceDirty();
polishAndUpdate();
emit pathChanged();
@@ -607,6 +609,7 @@ void QDeclarativePolylineMapItem::insertCoordinate(int index, const QGeoCoordina
path_.insert(index, coordinate);
geoLeftBound_ = getLeftBound(path_, deltaXs_, minX_);
+ geometry_.setPreserveGeometry(true, geoLeftBound_);
geometry_.markSourceDirty();
polishAndUpdate();
emit pathChanged();
@@ -629,6 +632,7 @@ void QDeclarativePolylineMapItem::replaceCoordinate(int index, const QGeoCoordin
path_[index] = coordinate;
geoLeftBound_ = getLeftBound(path_, deltaXs_, minX_);
+ geometry_.setPreserveGeometry(true, geoLeftBound_);
geometry_.markSourceDirty();
polishAndUpdate();
emit pathChanged();
@@ -697,6 +701,7 @@ void QDeclarativePolylineMapItem::removeCoordinate(int index)
path_.removeAt(index);
geoLeftBound_ = getLeftBound(path_, deltaXs_, minX_);
+ geometry_.setPreserveGeometry(true, geoLeftBound_);
geometry_.markSourceDirty();
polishAndUpdate();
emit pathChanged();