diff options
author | Jason Wray <jason@mapbox.com> | 2017-07-27 16:41:54 -0400 |
---|---|---|
committer | Jason Wray <jason@mapbox.com> | 2017-07-27 16:41:54 -0400 |
commit | ea81e04924463e86b765f5a76a2d2d7b66ef1521 (patch) | |
tree | 03fc45754e4c791f9b7e86e5f6b1fea71a5ac3c1 /platform/ios/src | |
parent | 5a53f156e89f7312a8d5a7b62c56be814e54574a (diff) | |
download | qtlocation-mapboxgl-upstream/fb-9595-minzoom-gesture.tar.gz |
Remove redundant minZoom limit in pinch gestureupstream/fb-9595-minzoom-gesture
Diffstat (limited to 'platform/ios/src')
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 1c544bfd33..a7c80dfdda 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -1295,16 +1295,17 @@ public: } else if (pinch.state == UIGestureRecognizerStateChanged) { + // Zoom limiting happens at the core level, in `mbgl::TransformState`. CGFloat newScale = self.scale * pinch.scale; - double zoom = MAX(log2(newScale), _mbglMap->getMinZoom()); + double newZoom = log2(newScale); // Calculates the final camera zoom, has no effect within current map camera. - MGLMapCamera *toCamera = [self cameraByZoomingToZoomLevel:zoom aroundAnchorPoint:centerPoint]; + MGLMapCamera *toCamera = [self cameraByZoomingToZoomLevel:newZoom aroundAnchorPoint:centerPoint]; if (![self.delegate respondsToSelector:@selector(mapView:shouldChangeFromCamera:toCamera:)] || [self.delegate mapView:self shouldChangeFromCamera:oldCamera toCamera:toCamera]) { - _mbglMap->setZoom(zoom, mbgl::ScreenCoordinate { centerPoint.x, centerPoint.y }); + _mbglMap->setZoom(newZoom, mbgl::ScreenCoordinate { centerPoint.x, centerPoint.y }); // The gesture recognizer only reports the gesture’s current center // point, so use the previous center point to anchor the transition. // If the number of touches has changed, the remembered center point is |