summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2018-07-27 13:51:47 +0200
committerPaolo Angelelli <paolo.angelelli@qt.io>2018-07-31 09:34:29 +0000
commit0e9d2d99742c92b049ec025f7ca3a333abd0de82 (patch)
treef60bf483907b9e4ed3494c751c859d61c0a8e5bd
parent8ad47514b1887dd813a545fe92e089b8e12cc18d (diff)
downloadqtlocation-0e9d2d99742c92b049ec025f7ca3a333abd0de82.tar.gz
Fix visibleArea handling in mapboxgl plugin
The empty visibleArea case was not handled properly. Change-Id: I1f04139e709ff7dab0b6db075d65d246a5b37cf9 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-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) {