diff options
author | Matthias Rauter <matthias.rauter@qt.io> | 2023-01-26 17:18:50 +0100 |
---|---|---|
committer | Matthias Rauter <matthias.rauter@qt.io> | 2023-02-14 16:31:13 +0100 |
commit | 8b9ecad4bed0150adcbdf91db3f5f9507a156fd6 (patch) | |
tree | 6cd08872c366a32ed041701654d15559325fd464 /src/location/quickmapitems/qdeclarativegeomapitembase.cpp | |
parent | b842a6cdcce0ee43a48ec084180d9dc065b599a1 (diff) | |
download | qtlocation-8b9ecad4bed0150adcbdf91db3f5f9507a156fd6.tar.gz |
Correct and improve the rendering of QuickMapItems
Various MapItems were not rendered correctly, especially in corner cases.
This change ensures that MapItems are rendered correctly in the vast
majority of cases.
All MapItems are shown correctly if they wrap around the globe and
appear twice on the map.
Circles that span around the globe or are located near poles are shown
correclty and filled all the way to the border of the map.
Polygons are shown correctly including their holes.
The code was simplified and some artefacts of previous implementations
were removed.
Fixes: QTBUG-110701
Fixes: QTBUG-110511
Pick-to: 6.5
Change-Id: I1110659989436cd5a93f6ec26f75caa06d5f2b71
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/location/quickmapitems/qdeclarativegeomapitembase.cpp')
-rw-r--r-- | src/location/quickmapitems/qdeclarativegeomapitembase.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/location/quickmapitems/qdeclarativegeomapitembase.cpp b/src/location/quickmapitems/qdeclarativegeomapitembase.cpp index c5b1cc8c..233ea82d 100644 --- a/src/location/quickmapitems/qdeclarativegeomapitembase.cpp +++ b/src/location/quickmapitems/qdeclarativegeomapitembase.cpp @@ -77,7 +77,7 @@ void QDeclarativeGeoMapItemBase::setMap(QDeclarativeGeoMap *quickMap, QGeoMap *m // For performance reasons we're not connecting map_'s and quickMap_'s signals to this. // Rather, the handling of cameraDataChanged, visibleAreaChanged, heightChanged and widthChanged is done explicitly in QDeclarativeGeoMap by directly calling methods on the items. // See QTBUG-76950 - lastSize_ = QSizeF(quickMap_->width(), quickMap_->height()); + lastMapSize_ = QSizeF(quickMap_->width(), quickMap_->height()); lastCameraData_ = map_->cameraData(); } } @@ -91,7 +91,7 @@ void QDeclarativeGeoMapItemBase::baseCameraDataChanged(const QGeoCameraData &cam evt.cameraData = cameraData; evt.mapSize = QSizeF(quickMap_->width(), quickMap_->height()); - if (evt.mapSize != lastSize_) + if (evt.mapSize != lastMapSize_) evt.mapSizeChanged = true; if (cameraData.bearing() != lastCameraData_.bearing()) @@ -105,7 +105,7 @@ void QDeclarativeGeoMapItemBase::baseCameraDataChanged(const QGeoCameraData &cam if (cameraData.zoomLevel() != lastCameraData_.zoomLevel()) evt.zoomLevelChanged = true; - lastSize_ = evt.mapSize; + lastMapSize_ = evt.mapSize; lastCameraData_ = cameraData; afterViewportChanged(evt); @@ -286,8 +286,6 @@ bool QDeclarativeGeoMapItemBase::isPolishScheduled() const return QQuickItemPrivate::get(this)->polishScheduled; } -void QDeclarativeGeoMapItemBase::setMaterialDirty() {} - void QDeclarativeGeoMapItemBase::polishAndUpdate() { polish(); |