diff options
author | Ansis Brammanis <ansis@mapbox.com> | 2018-02-21 11:36:40 -0500 |
---|---|---|
committer | Ansis Brammanis <ansis.brammanis@gmail.com> | 2018-02-21 14:38:30 -0500 |
commit | ebb72b9002f9d497e696a08030fcec2f489c273c (patch) | |
tree | 2406b615eb0b2a95191afdc124544e984108f156 /src/mbgl | |
parent | c2d9d6a4235d5bce5c10b40b3f8cfaeb331d7878 (diff) | |
download | qtlocation-mapboxgl-ebb72b9002f9d497e696a08030fcec2f489c273c.tar.gz |
[core] don't hide icons if text is an empty string
Diffstat (limited to 'src/mbgl')
-rw-r--r-- | src/mbgl/text/placement.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mbgl/text/placement.cpp b/src/mbgl/text/placement.cpp index fc24c78902..54b2b7539b 100644 --- a/src/mbgl/text/placement.cpp +++ b/src/mbgl/text/placement.cpp @@ -95,9 +95,6 @@ void Placement::placeLayerBucket( auto partiallyEvaluatedTextSize = bucket.textSizeBinder->evaluateForZoom(state.getZoom()); auto partiallyEvaluatedIconSize = bucket.iconSizeBinder->evaluateForZoom(state.getZoom()); - const bool iconWithoutText = !bucket.hasTextData() || bucket.layout.get<style::TextOptional>(); - const bool textWithoutIcon = !bucket.hasIconData() || bucket.layout.get<style::IconOptional>(); - for (auto& symbolInstance : bucket.symbolInstances) { if (seenCrossTileIDs.count(symbolInstance.crossTileID) == 0) { @@ -140,6 +137,9 @@ void Placement::placeLayerBucket( offscreen &= placed.second; } + const bool iconWithoutText = !symbolInstance.hasText || bucket.layout.get<style::TextOptional>(); + const bool textWithoutIcon = !symbolInstance.hasIcon || bucket.layout.get<style::IconOptional>(); + // combine placements for icon and text if (!iconWithoutText && !textWithoutIcon) { placeText = placeIcon = placeText && placeIcon; |