summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices/mapboxgl
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/geoservices/mapboxgl')
-rw-r--r--src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp
index 575bf3b4..4614de89 100644
--- a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp
+++ b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp
@@ -126,11 +126,15 @@ QSGNode *QGeoMapMapboxGLPrivate::updateSceneGraph(QSGNode *node, QQuickWindow *w
}
if (m_syncState & VisibleAreaSync) {
- QMargins margins(m_visibleArea.x(), // left
- m_visibleArea.y(), // top
- m_viewportSize.width() - m_visibleArea.width() - m_visibleArea.x(), // right
- m_viewportSize.height() - m_visibleArea.height() - m_visibleArea.y()); // bottom
- map->setMargins(margins);
+ if (m_visibleArea.isEmpty()) {
+ map->setMargins(QMargins());
+ } else {
+ QMargins margins(m_visibleArea.x(), // left
+ m_visibleArea.y(), // top
+ m_viewportSize.width() - m_visibleArea.width() - m_visibleArea.x(), // right
+ m_viewportSize.height() - m_visibleArea.height() - m_visibleArea.y()); // bottom
+ map->setMargins(margins);
+ }
}
if (m_syncState & CameraDataSync || m_syncState & VisibleAreaSync) {