From c7e6dc4832b3b5a6752a1c04def1485d0136c1c4 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 18 Apr 2017 16:34:19 -0700 Subject: [macos] Fix pinch gesture scaling math --- platform/macos/src/MGLMapView.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform/macos') diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index 01df48c3da..c56b32bfcf 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -1456,7 +1456,7 @@ public: [self willChangeValueForKey:@"zoomLevel"]; [self willChangeValueForKey:@"centerCoordinate"]; MGLMapCamera *oldCamera = self.camera; - _mbglMap->setZoom(_zoomAtBeginningOfGesture * (1 + gestureRecognizer.magnification), center); + _mbglMap->setZoom(_zoomAtBeginningOfGesture + log2(1 + gestureRecognizer.magnification), center); if ([self.delegate respondsToSelector:@selector(mapView:shouldChangeFromCamera:toCamera:)] && ![self.delegate mapView:self shouldChangeFromCamera:oldCamera toCamera:self.camera]) { self.camera = oldCamera; -- cgit v1.2.1