diff options
Diffstat (limited to 'src/location/declarativemaps/qquickgeomapgesturearea.cpp')
-rw-r--r-- | src/location/declarativemaps/qquickgeomapgesturearea.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/location/declarativemaps/qquickgeomapgesturearea.cpp b/src/location/declarativemaps/qquickgeomapgesturearea.cpp index 3511226c..992fa21e 100644 --- a/src/location/declarativemaps/qquickgeomapgesturearea.cpp +++ b/src/location/declarativemaps/qquickgeomapgesturearea.cpp @@ -949,7 +949,8 @@ void QQuickGeoMapGestureArea::handleWheelEvent(QWheelEvent *event) const QPointF &preZoomPoint = event->posF(); const double zoomLevelDelta = event->angleDelta().y() * qreal(0.001); - m_declarativeMap->setZoomLevel(m_declarativeMap->zoomLevel() + zoomLevelDelta); + // Gesture area should always honor maxZL, but Map might not. + m_declarativeMap->setZoomLevel(qMin<qreal>(m_declarativeMap->zoomLevel() + zoomLevelDelta, maximumZoomLevel())); const QPointF &postZoomPoint = m_map->geoProjection().coordinateToItemPosition(wheelGeoPos, false).toPointF(); if (preZoomPoint != postZoomPoint) // need to re-anchor the wheel geoPos to the event position @@ -1590,7 +1591,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(newZoomLevel); + m_declarativeMap->setZoomLevel(qMin<qreal>(newZoomLevel, maximumZoomLevel())); m_pinch.m_zoom.m_previous = newZoomLevel; } } |