From c815c1e2d661ae43584db0e6eed2a2aaf5fe7e14 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Thu, 8 Mar 2018 14:31:58 -0500 Subject: [ios] Fix pinch drift ignoring delegate camera change response --- platform/ios/CHANGELOG.md | 1 + platform/ios/src/MGLMapView.mm | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index e2052abb89..49b2add722 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -4,6 +4,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT ## 3.7.6 +* Fixed an issue where the pinch gesture could drift beyond bounds imposed by `-[MGLMapViewDelegate mapView:shouldChangeFromCamera:toCamera:]`. ([#11423](https://github.com/mapbox/mapbox-gl-native/pull/11423)) * Improved the visibility of the heading indicator arrow. ([#11337](https://github.com/mapbox/mapbox-gl-native/pull/11337)) ## 3.7.5 - February 16, 2018 diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 02f529d094..0fae5e0394 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -1459,10 +1459,12 @@ public: double zoom = log2(newScale); MGLMapCamera *toCamera = [self cameraByZoomingToZoomLevel:zoom aroundAnchorPoint:centerPoint]; - if ([self _shouldChangeFromCamera:oldCamera toCamera:toCamera]) + if ( ! [self _shouldChangeFromCamera:oldCamera toCamera:toCamera]) { drift = NO; - } else { + } + else + { if (drift) { _mbglMap->setZoom(zoom, mbgl::ScreenCoordinate { centerPoint.x, centerPoint.y }, MGLDurationFromTimeInterval(duration)); @@ -1695,7 +1697,9 @@ public: { [weakSelf unrotateIfNeededForGesture]; }]; - } else { + } + else + { [self unrotateIfNeededForGesture]; } } -- cgit v1.2.1