[ios] Fix pinch drift ignoring delegate camera change response

This commit is contained in:
Jason Wray
2018-03-08 14:31:58 -05:00
parent 7df451def6
commit c815c1e2d6
2 changed files with 8 additions and 3 deletions

View File

@@ -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

View File

@@ -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];
}
}