From 26c32f5c112784a8c5f84b96150de7c8ec7fedc1 Mon Sep 17 00:00:00 2001 From: Jesse Bounds Date: Mon, 3 Oct 2016 17:21:38 -0700 Subject: [PATCH] [ios] Remove double counting of content inset top and bottom (#6566) This removes the calls to top and bottom for content inset of the map view when calculating the edge padding for following. A previous commit added this along with the left and right values. This eliminates a bug where the map did not scroll to the correct location for the user dot and also a bug in `didUpdateLocationWithUserTrackingAnimated:` where the map panning operations would always occur because the current and correct points never matched up even if a stream of location values that were the same were processed. --- platform/ios/src/MGLMapView.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 4d660f8f3..bc11303ee 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -4173,9 +4173,9 @@ public: CGRect boundsAroundCorrectPoint = CGRectOffset(bounds, correctPoint.x - CGRectGetMidX(bounds), correctPoint.y - CGRectGetMidY(bounds)); - return UIEdgeInsetsMake(CGRectGetMinY(boundsAroundCorrectPoint) - CGRectGetMinY(bounds) + self.contentInset.top, + return UIEdgeInsetsMake(CGRectGetMinY(boundsAroundCorrectPoint) - CGRectGetMinY(bounds), self.contentInset.left, - CGRectGetMaxY(bounds) - CGRectGetMaxY(boundsAroundCorrectPoint) + self.contentInset.bottom, + CGRectGetMaxY(bounds) - CGRectGetMaxY(boundsAroundCorrectPoint), self.contentInset.right); }