From 1637a4b69449ae4919d39fdf6384fcdf1a003a3a Mon Sep 17 00:00:00 2001 From: Aleksandar Stojiljkovic Date: Wed, 29 May 2019 13:36:47 +0300 Subject: [ios] Content insets border case fix and comment. Allows changing camera when user duplicates content insets. Related to previous patch and comment: https://github.com/mapbox/mapbox-gl-native/pull/14664#pullrequestreview-243004376 Thanks @1ec5 --- platform/ios/src/MGLMapView.mm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index a304bfddfc..c2ab9c9fc1 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -3429,9 +3429,12 @@ public: }); }; } - + + // Padding is baked in adjusted camera center (in cameraForLatLngs) and + // cameraOptions.padding at this point is (0, 0, 0, 0) and we don't need to + // check if cameraOptions.contentInsets are equal to contentInsets. MGLMapCamera *camera = [self cameraForCameraOptions:cameraOptions]; - if ([self.camera isEqualToMapCamera:camera] && UIEdgeInsetsEqualToEdgeInsets(_contentInset, insets)) + if ([self.camera isEqualToMapCamera:camera]) { if (completion) { -- cgit v1.2.1