diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2016-06-22 23:22:41 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2016-06-23 00:03:51 -0700 |
commit | f5f39c8b3adfed4c4c102dca5d5be4d6cfc0b69f (patch) | |
tree | fe499dc49834240ffa5062688458aa308489768e /platform | |
parent | 3995d6ff68a51dd4543ad71f424adf261e1e8baf (diff) | |
download | qtlocation-mapboxgl-f5f39c8b3adfed4c4c102dca5d5be4d6cfc0b69f.tar.gz |
[ios, macos] Renamed overdraw to overdraw visualization (#5416)
A verb doesn’t make sense in this enum value. Instead, use a descriptive word for this effect and describe it in detail in the documentation comment.
Cherry-picked from 415c18294693166472785459f9d5bc8be31b7033.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/ios/CHANGELOG.md | 2 | ||||
-rw-r--r-- | platform/ios/app/MBXViewController.m | 8 | ||||
-rw-r--r-- | platform/ios/src/MGLMapView.h | 7 | ||||
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 4 | ||||
-rw-r--r-- | platform/macos/CHANGELOG.md | 3 | ||||
-rw-r--r-- | platform/macos/app/Base.lproj/MainMenu.xib | 10 | ||||
-rw-r--r-- | platform/macos/app/MapDocument.m | 10 | ||||
-rw-r--r-- | platform/macos/src/MGLMapView.h | 7 | ||||
-rw-r--r-- | platform/macos/src/MGLMapView.mm | 4 |
9 files changed, 30 insertions, 25 deletions
diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 60b3bad1dc..4f1d1b7374 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -33,7 +33,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CON - Removed unused SVG files from the SDK’s resource bundle. ([#4641](https://github.com/mapbox/mapbox-gl-native/pull/4641)) - Deprecated `-[MGLMapView emptyMemoryCache]`. ([#4725](https://github.com/mapbox/mapbox-gl-native/pull/4725)) - Added `MGLCoordinateInCoordinateBounds()`, a function that tests whether or not a coordinate is in a given bounds. ([#5053](https://github.com/mapbox/mapbox-gl-native/pull/5053)) -- Added a new option to `MGLMapDebugMaskOptions`, `MGLMapDebugWireframesMask`, that shows wireframes instead of the usual rendered output. ([#4359](https://github.com/mapbox/mapbox-gl-native/pull/4359)) +- Added a new option to `MGLMapDebugMaskOptions`, `MGLMapDebugOverdrawVisualizationMask`, that highlights overlapping drawing operations instead of the usual rendered output. ([#5403](https://github.com/mapbox/mapbox-gl-native/pull/5403)) ## 3.2.3 diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index 8317aee1d9..761644b29f 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -181,9 +181,9 @@ static NSString * const MBXViewControllerAnnotationViewReuseIdentifer = @"MBXVie ((debugMask & MGLMapDebugCollisionBoxesMask) ? @"Hide Collision Boxes" : @"Show Collision Boxes"), - ((debugMask & MGLMapDebugWireframesMask) - ? @"Hide Wireframes" - : @"Show Wireframes"), + ((debugMask & MGLMapDebugOverdrawVisualizationMask) + ? @"Hide Overdraw Visualization" + : @"Show Overdraw Visualization"), @"Add 100 Points", @"Add 1,000 Points", @"Add 10,000 Points", @@ -226,7 +226,7 @@ static NSString * const MBXViewControllerAnnotationViewReuseIdentifer = @"MBXVie } else if (buttonIndex == actionSheet.firstOtherButtonIndex + 5) { - self.mapView.debugMask ^= MGLMapDebugWireframesMask; + self.mapView.debugMask ^= MGLMapDebugOverdrawVisualizationMask; } else if (buttonIndex == actionSheet.firstOtherButtonIndex + 6) { diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h index d6bc25f961..3f649e45d2 100644 --- a/platform/ios/src/MGLMapView.h +++ b/platform/ios/src/MGLMapView.h @@ -43,9 +43,10 @@ typedef NS_OPTIONS(NSUInteger, MGLMapDebugMaskOptions) { /** Edges of glyphs and symbols are shown as faint, green lines to help diagnose collision and label placement issues. */ MGLMapDebugCollisionBoxesMask = 1 << 4, - /** Line widths, backgrounds, and fill colors are ignored to create a - wireframe effect. */ - MGLMapDebugWireframesMask = 1 << 5, + /** Each drawing operation is replaced by a translucent fill. Overlapping + drawing operations appear more prominent to help diagnose overdrawing. + */ + MGLMapDebugOverdrawVisualizationMask = 1 << 5, }; /** diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 7f09113f5b..2c76f3b850 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -1831,7 +1831,7 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration) } if (options & mbgl::MapDebugOptions::Wireframe) { - mask |= MGLMapDebugWireframesMask; + mask |= MGLMapDebugOverdrawVisualizationMask; } return mask; } @@ -1855,7 +1855,7 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration) { options |= mbgl::MapDebugOptions::Collision; } - if (debugMask & MGLMapDebugWireframesMask) + if (debugMask & MGLMapDebugOverdrawVisualizationMask) { options |= mbgl::MapDebugOptions::Wireframe; } diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md index 95cb154201..1502b8ece0 100644 --- a/platform/macos/CHANGELOG.md +++ b/platform/macos/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog for Mapbox macOS SDK ## master +* Replaced the wireframe debug mask with an overdraw visualization debug mask to match Mapbox GL JS’s overdraw inspector. ([#5403](https://github.com/mapbox/mapbox-gl-native/pull/5403)) + +## 0.2.0 * Renamed the SDK to the Mapbox macOS SDK. * Fixed an issue in which Mapbox.framework was nested inside another folder named Mapbox.framework. ([#4998](https://github.com/mapbox/mapbox-gl-native/pull/4998)) diff --git a/platform/macos/app/Base.lproj/MainMenu.xib b/platform/macos/app/Base.lproj/MainMenu.xib index c80428ff00..36fb02736c 100644 --- a/platform/macos/app/Base.lproj/MainMenu.xib +++ b/platform/macos/app/Base.lproj/MainMenu.xib @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> -<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct"> +<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11129.15" systemVersion="15F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct"> <dependencies> - <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/> + <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11129.15"/> </dependencies> <objects> <customObject id="-2" userLabel="File's Owner" customClass="NSApplication"> @@ -461,10 +461,10 @@ <action selector="toggleCollisionBoxes:" target="-1" id="EYa-7n-iWZ"/> </connections> </menuItem> - <menuItem title="Show Wireframes" id="hSX-Be-8xC"> + <menuItem title="Show Overdraw Visualization" id="hSX-Be-8xC"> <modifierMask key="keyEquivalentModifierMask"/> <connections> - <action selector="toggleWireframes:" target="-1" id="usj-ug-upt"/> + <action selector="toggleOverdrawVisualization:" target="-1" id="usj-ug-upt"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="2EG-Hp-4FA"/> @@ -672,7 +672,7 @@ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" autosaveColumns="NO" headerView="MAZ-Iq-hBi" id="Ato-Vu-HYT"> - <rect key="frame" x="0.0" y="0.0" width="400" height="257"/> + <rect key="frame" x="0.0" y="0.0" width="423" height="257"/> <autoresizingMask key="autoresizingMask"/> <size key="intercellSpacing" width="3" height="2"/> <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> diff --git a/platform/macos/app/MapDocument.m b/platform/macos/app/MapDocument.m index e9f3b99592..1b920a029b 100644 --- a/platform/macos/app/MapDocument.m +++ b/platform/macos/app/MapDocument.m @@ -276,8 +276,8 @@ NS_ARRAY_OF(id <MGLAnnotation>) *MBXFlattenedShapes(NS_ARRAY_OF(id <MGLAnnotatio self.mapView.debugMask ^= MGLMapDebugCollisionBoxesMask; } -- (IBAction)toggleWireframes:(id)sender { - self.mapView.debugMask ^= MGLMapDebugWireframesMask; +- (IBAction)toggleOverdrawVisualization:(id)sender { + self.mapView.debugMask ^= MGLMapDebugOverdrawVisualizationMask; } - (IBAction)showColorBuffer:(id)sender { @@ -585,9 +585,9 @@ NS_ARRAY_OF(id <MGLAnnotation>) *MBXFlattenedShapes(NS_ARRAY_OF(id <MGLAnnotatio menuItem.title = isShown ? @"Hide Collision Boxes" : @"Show Collision Boxes"; return YES; } - if (menuItem.action == @selector(toggleWireframes:)) { - BOOL isShown = self.mapView.debugMask & MGLMapDebugWireframesMask; - menuItem.title = isShown ? @"Hide Wireframes" : @"Show Wireframes"; + if (menuItem.action == @selector(toggleOverdrawVisualization:)) { + BOOL isShown = self.mapView.debugMask & MGLMapDebugOverdrawVisualizationMask; + menuItem.title = isShown ? @"Hide Overdraw Visualization" : @"Show Overdraw Visualization"; return YES; } if (menuItem.action == @selector(showColorBuffer:)) { diff --git a/platform/macos/src/MGLMapView.h b/platform/macos/src/MGLMapView.h index 7b3efd293b..8f1fa40137 100644 --- a/platform/macos/src/MGLMapView.h +++ b/platform/macos/src/MGLMapView.h @@ -21,9 +21,10 @@ typedef NS_OPTIONS(NSUInteger, MGLMapDebugMaskOptions) { diagnose collision and label placement issues. */ MGLMapDebugCollisionBoxesMask = 1 << 4, - /** Line widths, backgrounds, and fill colors are ignored to create a - wireframe effect. */ - MGLMapDebugWireframesMask = 1 << 5, + /** Each drawing operation is replaced by a translucent fill. Overlapping + drawing operations appear more prominent to help diagnose overdrawing. + */ + MGLMapDebugOverdrawVisualizationMask = 1 << 5, /** The stencil buffer is shown instead of the color buffer. */ MGLMapDebugStencilBufferMask = 1 << 6, diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index 2f985b85d8..e02a878bb1 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -2399,7 +2399,7 @@ public: mask |= MGLMapDebugCollisionBoxesMask; } if (options & mbgl::MapDebugOptions::Wireframe) { - mask |= MGLMapDebugWireframesMask; + mask |= MGLMapDebugOverdrawVisualizationMask; } if (options & mbgl::MapDebugOptions::StencilClip) { mask |= MGLMapDebugStencilBufferMask; @@ -2421,7 +2421,7 @@ public: if (debugMask & MGLMapDebugCollisionBoxesMask) { options |= mbgl::MapDebugOptions::Collision; } - if (debugMask & MGLMapDebugWireframesMask) { + if (debugMask & MGLMapDebugOverdrawVisualizationMask) { options |= mbgl::MapDebugOptions::Wireframe; } if (debugMask & MGLMapDebugStencilBufferMask) { |