diff options
author | Jason Wray <jason@mapbox.com> | 2018-03-08 14:31:58 -0500 |
---|---|---|
committer | Jason Wray <jason@mapbox.com> | 2018-03-14 15:46:31 -0400 |
commit | d37edadacbe20cd9fa71100d53098291ee7ea619 (patch) | |
tree | 81de3728aa2a09595cadf2881bc93035bd45a21b | |
parent | 2230af142540a041e0583e81cda49a0064be4044 (diff) | |
download | qtlocation-mapboxgl-d37edadacbe20cd9fa71100d53098291ee7ea619.tar.gz |
[ios] Fix pinch drift ignoring delegate camera change response
-rw-r--r-- | platform/ios/CHANGELOG.md | 1 | ||||
-rw-r--r-- | 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 c50aac7b2e..893fd0e5ea 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -55,6 +55,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 18a69a34cd..6b47dc05f7 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -1476,10 +1476,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)); @@ -1730,7 +1732,9 @@ public: { [weakSelf unrotateIfNeededForGesture]; }]; - } else { + } + else + { [self unrotateIfNeededForGesture]; } } |