From bd9e6a22560ceed4c7a204cb0925978b3ff654d2 Mon Sep 17 00:00:00 2001 From: Josef Nilsen Date: Sun, 4 Jun 2023 06:45:40 +0200 Subject: [PATCH] Center zoom on pinch zoom gesture (not just on move gesture) --- lib/src/gestures/gestures.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/gestures/gestures.dart b/lib/src/gestures/gestures.dart index 9e51748e4..2033dfd8a 100644 --- a/lib/src/gestures/gestures.dart +++ b/lib/src/gestures/gestures.dart @@ -435,7 +435,7 @@ abstract class MapGestureMixin extends State } } - if (_pinchMoveStarted) { + if (_pinchZoomStarted || _pinchMoveStarted) { final oldCenterPt = mapState.project(mapState.center, newZoom); final newFocalLatLong = _offsetToCrs(_focalStartLocal, newZoom); final newFocalPt = mapState.project(newFocalLatLong, newZoom);