diff options
author | Fabian Guerra Soto <fabian.guerra@mapbox.com> | 2019-06-03 07:32:20 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-03 07:32:20 -0700 |
commit | 402645109f8d0535cac132d824d39f38a4f1c558 (patch) | |
tree | 61969265c1e4c6bb9840d8f376260301d7e32556 /platform/macos | |
parent | b2428835871933ecf5a93e86493bac0b76db0ede (diff) | |
download | qtlocation-mapboxgl-402645109f8d0535cac132d824d39f38a4f1c558.tar.gz |
[ios] Fix content insets with custom edge padding. (#14813)
* [ios] Fix content insets with custom edge padding.
* [ios, macos] Consolidated edge insets math
* [macos] Add content insets to edge padding when setting camera
* [ios, macos] Updated changelogs
* [ios, macos] Clarify setCamera:withDuration:animationTimingFunction:edgePadding method documentation.
Diffstat (limited to 'platform/macos')
-rw-r--r-- | platform/macos/CHANGELOG.md | 4 | ||||
-rw-r--r-- | platform/macos/src/MGLMapView.h | 3 | ||||
-rw-r--r-- | platform/macos/src/MGLMapView.mm | 3 |
3 files changed, 8 insertions, 2 deletions
diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md index e3f1c84547..520f8c204b 100644 --- a/platform/macos/CHANGELOG.md +++ b/platform/macos/CHANGELOG.md @@ -6,6 +6,10 @@ * Setting `MGLMapView.contentInset` now moves the map’s focal point to the center of the content frame after insetting. ([#14664](https://github.com/mapbox/mapbox-gl-native/pull/14664)) +### Other changes + +* The `-[MGLMapView setCamera:withDuration:animationTimingFunction:edgePadding:completionHandler:]` method now adds the current value of the `MGLMapView.contentInsets` property to the `edgePadding` parameter. ([#14813](https://github.com/mapbox/mapbox-gl-native/pull/14813)) + ## 0.14.0 - May 22, 2018 ### Styles and rendering diff --git a/platform/macos/src/MGLMapView.h b/platform/macos/src/MGLMapView.h index ddb5747109..21ae8c2974 100644 --- a/platform/macos/src/MGLMapView.h +++ b/platform/macos/src/MGLMapView.h @@ -325,7 +325,8 @@ MGL_EXPORT IB_DESIGNABLE /** Moves the viewpoint to a different location with respect to the map with an - optional transition duration and timing function. + optional transition duration and timing function, and optionally some additional + padding on each side. @param camera The new viewpoint. @param duration The amount of time, measured in seconds, that the transition diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index 589a39f0b3..04b895bb50 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -1168,10 +1168,11 @@ public: - (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function completionHandler:(nullable void (^)(void))completion { MGLLogDebug(@"Setting camera: %@ duration: %f animationTimingFunction: %@", camera, duration, function); - [self setCamera:camera withDuration:duration animationTimingFunction:function edgePadding:self.contentInsets completionHandler:completion]; + [self setCamera:camera withDuration:duration animationTimingFunction:function edgePadding:NSEdgeInsetsZero completionHandler:completion]; } - (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function edgePadding:(NSEdgeInsets)edgePadding completionHandler:(nullable void (^)(void))completion { + edgePadding = MGLEdgeInsetsInsetEdgeInset(edgePadding, self.contentInsets); mbgl::AnimationOptions animationOptions; if (duration > 0) { animationOptions.duration.emplace(MGLDurationFromTimeInterval(duration)); |