summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-08-23 18:12:35 -0700
committerGitHub <noreply@github.com>2016-08-23 18:12:35 -0700
commit9720f581ff614f625819c31ea6f26f61b930342b (patch)
tree42674412021b3d888a8cda7ffb3eca25bab98e42 /platform
parenta5b089de6289acc588683951fd3c5cf081c30fd8 (diff)
downloadqtlocation-mapboxgl-9720f581ff614f625819c31ea6f26f61b930342b.tar.gz
[macos] Avoid negative content insets (#6102)
Fixed an issue in which a map view that doesn’t occupy the entire window would consider its center point to be the window’s center point rather than the view’s.
Diffstat (limited to 'platform')
-rw-r--r--platform/macos/CHANGELOG.md1
-rw-r--r--platform/macos/src/MGLMapView.mm4
2 files changed, 3 insertions, 2 deletions
diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md
index 2e51a4d3d3..d0d2d0b5ae 100644
--- a/platform/macos/CHANGELOG.md
+++ b/platform/macos/CHANGELOG.md
@@ -7,6 +7,7 @@
* A new runtime styling API allows you to adjust the style and content of the base map dynamically. All the options available in [Mapbox Studio](https://www.mapbox.com/studio/) are now exposed via MGLStyle and subclasses of MGLStyleLayer and MGLSource. ([#5727](https://github.com/mapbox/mapbox-gl-native/pull/5727))
* Improved offline and ambient cache database performance. ([#5796](https://github.com/mapbox/mapbox-gl-native/pull/5796))
* Added `showAnnotations:animated:` and `showAnnotations:edgePadding:animated:`, which moves the map viewport to show the specified annotations. ([#5749](https://github.com/mapbox/mapbox-gl-native/pull/5749))
+* Fixed an issue where the map view’s center would always be calculated as if the view occupied the entire window. ([#6102](https://github.com/mapbox/mapbox-gl-native/pull/6102))
* To make an MGLPolyline or MGLPolygon span the antimeridian, specify coordinates with longitudes greater than 180° or less than −180°. ([#6088](https://github.com/mapbox/mapbox-gl-native/pull/6088))
* MGLMapView’s `styleURL` property can now be set to an absolute file URL. ([#6026](https://github.com/mapbox/mapbox-gl-native/pull/6026))
* GeoJSON sources specified by the stylesheet at design time now support `cluster`, `clusterMaxZoom`, and `clusterRadius` attributes for clustering point features on the base map. ([#5724](https://github.com/mapbox/mapbox-gl-native/pull/5724))
diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm
index 7b7ab0247b..a222f55fa0 100644
--- a/platform/macos/src/MGLMapView.mm
+++ b/platform/macos/src/MGLMapView.mm
@@ -1180,8 +1180,8 @@ public:
NSRect contentLayoutRect = [self convertRect:self.window.contentLayoutRect fromView:nil];
if (NSMaxX(contentLayoutRect) > 0 && NSMaxY(contentLayoutRect) > 0) {
contentInsets = NSEdgeInsetsMake(NSHeight(self.bounds) - NSMaxY(contentLayoutRect),
- NSMinX(contentLayoutRect),
- NSMinY(contentLayoutRect),
+ MAX(NSMinX(contentLayoutRect), 0),
+ MAX(NSMinY(contentLayoutRect), 0),
NSWidth(self.bounds) - NSMaxX(contentLayoutRect));
}
} else {