summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2018-03-01 12:15:57 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2018-03-01 12:46:30 +0000
commit8666201dcc76b277a2d5a77b84ed7e7114b76987 (patch)
tree22e28e6c9d26d405001e61305b37eee849f89321 /src/location/declarativemaps/qdeclarativerectanglemapitem.cpp
parentae00734245f30de4a777bbfc4be73917dfae142a (diff)
downloadqtlocation-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/qdeclarativerectanglemapitem.cpp')
-rw-r--r--src/location/declarativemaps/qdeclarativerectanglemapitem.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp b/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp
index 0206ac96..54706ad7 100644
--- a/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp
+++ b/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp
@@ -273,9 +273,15 @@ QSGNode *QDeclarativeRectangleMapItem::updateMapItemPaintNode(QSGNode *oldNode,
*/
void QDeclarativeRectangleMapItem::updatePolish()
{
- if (!map() || !topLeft().isValid() || !bottomRight().isValid()
- || map()->geoProjection().projectionType() != QGeoProjection::ProjectionWebMercator)
+ if (!map() || map()->geoProjection().projectionType() != QGeoProjection::ProjectionWebMercator)
return;
+ if (!topLeft().isValid() || !bottomRight().isValid()) {
+ geometry_.clear();
+ borderGeometry_.clear();
+ setWidth(0);
+ setHeight(0);
+ return;
+ }
const QGeoProjectionWebMercator &p = static_cast<const QGeoProjectionWebMercator&>(map()->geoProjection());