summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Loer <chris.loer@gmail.com>2018-08-13 12:45:03 -0700
committerChris Loer <chris.loer@mapbox.com>2018-08-13 14:31:30 -0700
commit41d5768f5861c200dc0721acb13b39783a168b29 (patch)
treefa7ea139db124dce4220d1884acf6142674636b0 /src
parentd886d3e4c04801e57340f98761cf76eec29e969d (diff)
downloadqtlocation-mapboxgl-41d5768f5861c200dc0721acb13b39783a168b29.tar.gz
[core] Don't default-show text/icons that depend on the placement of a paired icon/text
Fixes issue #12483.
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/text/placement.cpp11
1 files changed, 9 insertions, 2 deletions
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<uint32_t>&
JointOpacityState duplicateOpacityState(false, false, true);
+ const bool textAllowOverlap = bucket.layout.get<style::TextAllowOverlap>();
+ const bool iconAllowOverlap = bucket.layout.get<style::IconAllowOverlap>();
+
+ // 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<style::TextAllowOverlap>(),
- bucket.layout.get<style::IconAllowOverlap>(),
+ textAllowOverlap && (iconAllowOverlap || !bucket.hasIconData() || bucket.layout.get<style::IconOptional>()),
+ iconAllowOverlap && (textAllowOverlap || !bucket.hasTextData() || bucket.layout.get<style::TextOptional>()),
true);
for (SymbolInstance& symbolInstance : bucket.symbolInstances) {