diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-03-01 12:15:57 +0100 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-03-01 12:46:30 +0000 |
commit | 8666201dcc76b277a2d5a77b84ed7e7114b76987 (patch) | |
tree | 22e28e6c9d26d405001e61305b37eee849f89321 /src/location/declarativemaps/qdeclarativepolylinemapitem.cpp | |
parent | ae00734245f30de4a777bbfc4be73917dfae142a (diff) | |
download | qtlocation-8666201dcc76b277a2d5a77b84ed7e7114b76987.tar.gz |
Fix re-set map items rendering stale geometry
Geometries are now cleared if data is invalid, before early return.
Task-number: QTBUG-66758
Change-Id: Ie89248f78b5fd817a33ed5d6ff56b3547d64a50b
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/location/declarativemaps/qdeclarativepolylinemapitem.cpp')
-rw-r--r-- | src/location/declarativemaps/qdeclarativepolylinemapitem.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp b/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp index 90ed95e4..3b004dce 100644 --- a/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp +++ b/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp @@ -748,9 +748,14 @@ void QDeclarativePolylineMapItem::updateCache() */ void QDeclarativePolylineMapItem::updatePolish() { - if (!map() || geopath_.path().length() == 0 - || map()->geoProjection().projectionType() != QGeoProjection::ProjectionWebMercator) + if (!map() || map()->geoProjection().projectionType() != QGeoProjection::ProjectionWebMercator) + return; + if (geopath_.path().length() == 0) { // Possibly cleared + geometry_.clear(); + setWidth(0); + setHeight(0); return; + } QScopedValueRollback<bool> rollback(updatingGeometry_); updatingGeometry_ = true; |