summaryrefslogtreecommitdiff
path: root/src/location/quickmapitems/qdeclarativegeomap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/location/quickmapitems/qdeclarativegeomap.cpp')
-rw-r--r--src/location/quickmapitems/qdeclarativegeomap.cpp20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/location/quickmapitems/qdeclarativegeomap.cpp b/src/location/quickmapitems/qdeclarativegeomap.cpp
index 0b4fcde9..c232010b 100644
--- a/src/location/quickmapitems/qdeclarativegeomap.cpp
+++ b/src/location/quickmapitems/qdeclarativegeomap.cpp
@@ -1868,23 +1868,12 @@ void QDeclarativeGeoMap::updateItemToWindowTransform()
return;
// Update itemToWindowTransform into QGeoProjection
- const QTransform item2WindowOld = m_map->geoProjection().itemToWindowTransform();
QTransform item2Window = QQuickItemPrivate::get(this)->itemToWindowTransform();
if (!property("layer").isNull() && property("layer").value<QObject *>()->property("enabled").toBool())
item2Window.reset(); // When layer is enabled, the item is rendered offscreen with no transformation, then the layer is applied
m_map->setItemToWindowTransform(item2Window);
- // This method is called at every redraw, including those redraws not generated by
- // sgNodeChanged.
- // In these cases, *if* the item2windowTransform has changed (e.g., if transformation of
- // the item or one of its ancestors changed), a forced update of the map items using accelerated
- // GL implementation has to be performed in order to have them pulling the updated itemToWindowTransform.
- if (!m_sgNodeHasChanged && item2WindowOld != item2Window) {
- for (auto i: std::as_const(m_mapItems))
- i->setMaterialDirty();
- }
-
m_sgNodeHasChanged = false;
}
@@ -2112,10 +2101,11 @@ void QDeclarativeGeoMap::fitViewportToMapItemsRefine(const QList<QPointer<QDecla
bottomRightX = topLeftX + brect.width();
bottomRightY = topLeftY + brect.height();
} else {
- topLeftX = item->position().x();
- topLeftY = item->position().y();
- bottomRightX = topLeftX + item->width();
- bottomRightY = topLeftY + item->height();
+ QGeoRectangle brect = item->geoShape().boundingGeoRectangle();
+ topLeftX = fromCoordinate(brect.topLeft(), false).x();
+ topLeftY = fromCoordinate(brect.topLeft(), false).y();
+ bottomRightX = fromCoordinate(brect.bottomRight(), false).x();
+ bottomRightY = fromCoordinate(brect.bottomRight(), false).y();
}
minX = qMin(minX, topLeftX);