Commit 79a0d8c6 authored by Volker Krause's avatar Volker Krause
Browse files

Fix pinch zoom conflicting with map panning

parent 2b5b7266
Pipeline #94367 passed with stage
in 17 seconds
......@@ -47,6 +47,7 @@ Item {
id: flickable
boundsBehavior: Flickable.StopAtBounds
clip: true
interactive: !pinchHandler.active
contentX: map.view.panX
contentY: map.view.panY
contentWidth: map.view.panWidth
......@@ -99,7 +100,8 @@ Item {
initialZoom = map.view.zoomLevel
}
onActiveScaleChanged: {
map.view.setZoomLevel(pinchHandler.initialZoom + Math.log2(pinchHandler.activeScale), pinchHandler.centroid.pressPosition);
map.view.setZoomLevel(pinchHandler.initialZoom + Math.log2(pinchHandler.activeScale),
Qt.point(pinchHandler.centroid.position.x - flickable.contentX, pinchHandler.centroid.position.y - flickable.contentY));
}
xAxis.enabled: false
yAxis.enabled: false
......
......@@ -92,7 +92,7 @@ public:
/** Converts a point in scene coordinates to screen coordinates. */
QPointF mapSceneToScreen(QPointF scenePos) const;
/** Converts a rectanble in scene coordinates to screen coordinates. */
/** Converts a rectangle in scene coordinates to screen coordinates. */
QRectF mapSceneToScreen(const QRectF &sceneRect) const;
/** Converts a point in screen coordinates to scene coordinates. */
QPointF mapScreenToScene(QPointF screenPos) const;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment