From 41d5768f5861c200dc0721acb13b39783a168b29 Mon Sep 17 00:00:00 2001 From: Chris Loer Date: Mon, 13 Aug 2018 12:45:03 -0700 Subject: [core] Don't default-show text/icons that depend on the placement of a paired icon/text Fixes issue #12483. --- platform/android/CHANGELOG.md | 5 ++++- platform/ios/CHANGELOG.md | 1 + platform/macos/CHANGELOG.md | 2 ++ platform/node/CHANGELOG.md | 1 + src/mbgl/text/placement.cpp | 11 +++++++++-- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/platform/android/CHANGELOG.md b/platform/android/CHANGELOG.md index 2df4bf18da..a7113546b5 100644 --- a/platform/android/CHANGELOG.md +++ b/platform/android/CHANGELOG.md @@ -2,6 +2,9 @@ Mapbox welcomes participation and contributions from everyone. If you'd like to do so please see the [`Contributing Guide`](https://github.com/mapbox/mapbox-gl-native/blob/master/CONTRIBUTING.md) first to get started. +## master +- Don't default-show text/icons that depend on the placement of a paired icon/text [#12483](https://github.com/mapbox/mapbox-gl-native/issues/12483) + ## 6.4.0-beta.1 - August 9, 2018 - Don't prefetch tiles for geojson sources [#12529](https://github.com/mapbox/mapbox-gl-native/pull/12529) - Enable LTO in release builds [#12546](https://github.com/mapbox/mapbox-gl-native/pull/12546) @@ -44,7 +47,7 @@ Mapbox welcomes participation and contributions from everyone. If you'd like to - Add LatLngForScreenCoordinate to MapSnapshotter API, This allows to convert a LatLng value to the x,y position on the MapSnasphot image [#12221](https://github.com/mapbox/mapbox-gl-native/pull/12221) - Expose multiple getCameraFor equivalent methods to convert a geometry or a bounds to a camera position with taking in account padding, tilt and bearing [#12290](https://github.com/mapbox/mapbox-gl-native/pull/12290) - Avoid race condition when calling getMapAsync from a non-UI thread when running instrumentation tests [#12308](https://github.com/mapbox/mapbox-gl-native/pull/12308) - + ## 6.2.1 - June 27, 2018 - Backport range alpha values from 0 to 1 with int color conversion [#12235](https://github.com/mapbox/mapbox-gl-native/pull/12235) diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 59d5cac39b..cf03852328 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -6,6 +6,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Improved the Swift interface for `MGLMapView.decelerationRate`. ([#12584](https://github.com/mapbox/mapbox-gl-native/issues/12584)) * Fixed inconsistencies in exception naming. ([#12583](https://github.com/mapbox/mapbox-gl-native/issues/12583)) +* Don't default-show text/icons that depend on the placement of a paired icon/text [#12483](https://github.com/mapbox/mapbox-gl-native/issues/12483) ## 4.3.0 diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md index bfc94b28ad..c0266aff5a 100644 --- a/platform/macos/CHANGELOG.md +++ b/platform/macos/CHANGELOG.md @@ -2,6 +2,8 @@ # master +- Don't default-show text/icons that depend on the placement of a paired icon/text [#12483](https://github.com/mapbox/mapbox-gl-native/issues/12483) + ## Styles and rendering * Token string syntax (`"{token}"`) in `MGLSymbolStyleLayer` `text` and `iconImageName` properties is now correctly converted to the appropriate `NSExpression` equivalent. ([#11659](https://github.com/mapbox/mapbox-gl-native/issues/11659)) diff --git a/platform/node/CHANGELOG.md b/platform/node/CHANGELOG.md index 8ce4756814..81210ab153 100644 --- a/platform/node/CHANGELOG.md +++ b/platform/node/CHANGELOG.md @@ -1,4 +1,5 @@ # master +- Don't default-show text/icons that depend on the placement of a paired icon/text [#12483](https://github.com/mapbox/mapbox-gl-native/issues/12483) - The `Map` constructor now accepts a `mode` option which can be either `"static"` (default) or `"tile"`. It must be set to `"tile"` when rendering individual tiles in order for the symbols to match across tiles. - Remove unnecessary memory use when collision debug mode is not enabled ([#12294](https://github.com/mapbox/mapbox-gl-native/issues/12294)) - Added support for rendering `symbol-placement: line-center` ([#12337](https://github.com/mapbox/mapbox-gl-native/pull/12337)) diff --git a/src/mbgl/text/placement.cpp b/src/mbgl/text/placement.cpp index 8bd92087b1..a050be4648 100644 --- a/src/mbgl/text/placement.cpp +++ b/src/mbgl/text/placement.cpp @@ -254,9 +254,16 @@ void Placement::updateBucketOpacities(SymbolBucket& bucket, std::set& JointOpacityState duplicateOpacityState(false, false, true); + const bool textAllowOverlap = bucket.layout.get(); + const bool iconAllowOverlap = bucket.layout.get(); + + // If allow-overlap is true, we can show symbols before placement runs on them + // But we have to wait for placement if we potentially depend on a paired icon/text + // with allow-overlap: false. + // See https://github.com/mapbox/mapbox-gl-native/issues/12483 JointOpacityState defaultOpacityState( - bucket.layout.get(), - bucket.layout.get(), + textAllowOverlap && (iconAllowOverlap || !bucket.hasIconData() || bucket.layout.get()), + iconAllowOverlap && (textAllowOverlap || !bucket.hasTextData() || bucket.layout.get()), true); for (SymbolInstance& symbolInstance : bucket.symbolInstances) { -- cgit v1.2.1