summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-04-18 16:34:19 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-04-19 08:01:25 -0700
commitc7e6dc4832b3b5a6752a1c04def1485d0136c1c4 (patch)
tree7578a9e0403f59d2b126df92be125fd24faf74d5
parent553ec88dc0350b9b034a0370300653d94f092382 (diff)
downloadqtlocation-mapboxgl-c7e6dc4832b3b5a6752a1c04def1485d0136c1c4.tar.gz
[macos] Fix pinch gesture scaling math
-rw-r--r--platform/macos/src/MGLMapView.mm2
1 files changed, 1 insertions, 1 deletions
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;