summaryrefslogtreecommitdiffstats
path: root/src/location/declarativemaps/qquickgeomapgesturearea.cpp
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2017-05-02 16:04:13 +0200
committerPaolo Angelelli <paolo.angelelli@qt.io>2017-05-03 16:42:26 +0000
commit18f7e6dc9f59159b70cb7e6a8745738f42d4f46f (patch)
tree6e0bf8a54ebeb4bbbd09cba57b673a9e662259e2 /src/location/declarativemaps/qquickgeomapgesturearea.cpp
parent61bb8c49ec662adf1622cd0bf91de51a2305adb9 (diff)
Fix for MapGestureArea pinch and scroll wheel not honoring min zoom
This patch fixes a regression introduced with e81ba34a98b259723e783e2d2df4321309992291, which made possible to zoom below the minimum valid zoom level for a viewport size. Change-Id: I4e71530b9bc5423ea24083146963c3bd0928f14a Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/location/declarativemaps/qquickgeomapgesturearea.cpp')
-rw-r--r--src/location/declarativemaps/qquickgeomapgesturearea.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/location/declarativemaps/qquickgeomapgesturearea.cpp b/src/location/declarativemaps/qquickgeomapgesturearea.cpp
index 13c667e6..a40afd68 100644
--- a/src/location/declarativemaps/qquickgeomapgesturearea.cpp
+++ b/src/location/declarativemaps/qquickgeomapgesturearea.cpp
@@ -953,7 +953,8 @@ void QQuickGeoMapGestureArea::handleWheelEvent(QWheelEvent *event)
const double zoomLevelDelta = event->angleDelta().y() * qreal(0.001);
// Gesture area should always honor maxZL, but Map might not.
- m_declarativeMap->setZoomLevel(qMin<qreal>(m_declarativeMap->zoomLevel() + zoomLevelDelta, maximumZoomLevel()));
+ m_declarativeMap->setZoomLevel(qMin<qreal>(m_declarativeMap->zoomLevel() + zoomLevelDelta, maximumZoomLevel()),
+ false);
const QPointF &postZoomPoint = m_map->geoProjection().coordinateToItemPosition(wheelGeoPos, false).toPointF();
if (preZoomPoint != postZoomPoint) // need to re-anchor the wheel geoPos to the event position
@@ -1595,7 +1596,7 @@ void QQuickGeoMapGestureArea::updatePinch()
qreal perPinchMinimumZoomLevel = qMax(m_pinch.m_zoom.m_start - m_pinch.m_zoom.maximumChange, m_pinch.m_zoom.m_minimum);
qreal perPinchMaximumZoomLevel = qMin(m_pinch.m_zoom.m_start + m_pinch.m_zoom.maximumChange, m_pinch.m_zoom.m_maximum);
newZoomLevel = qMin(qMax(perPinchMinimumZoomLevel, newZoomLevel), perPinchMaximumZoomLevel);
- m_declarativeMap->setZoomLevel(qMin<qreal>(newZoomLevel, maximumZoomLevel()));
+ m_declarativeMap->setZoomLevel(qMin<qreal>(newZoomLevel, maximumZoomLevel()), false);
m_pinch.m_zoom.m_previous = newZoomLevel;
}
}