From ea81e04924463e86b765f5a76a2d2d7b66ef1521 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Thu, 27 Jul 2017 16:41:54 -0400 Subject: Remove redundant minZoom limit in pinch gesture --- platform/ios/src/MGLMapView.mm | 7 ++++--- 1 file 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 -- cgit v1.2.1