Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[core] don't hide icons if text is an empty string #11206

Merged
merged 1 commit into from
Feb 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion platform/node/test/ignores.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"render-tests/regressions/mapbox-gl-js#5599": "https://github.com/mapbox/mapbox-gl-native/issues/10399",
"render-tests/regressions/mapbox-gl-js#5740": "https://github.com/mapbox/mapbox-gl-native/issues/10619",
"render-tests/regressions/mapbox-gl-js#5982": "https://github.com/mapbox/mapbox-gl-native/issues/10619",
"render-tests/regressions/mapbox-gl-js#6160": "https://github.com/mapbox/mapbox-gl-native/pull/11206",
"render-tests/regressions/mapbox-gl-native#7357": "https://github.com/mapbox/mapbox-gl-native/issues/7357",
"render-tests/runtime-styling/image-add-sdf": "https://github.com/mapbox/mapbox-gl-native/issues/9847",
"render-tests/runtime-styling/paint-property-fill-flat-to-extrude": "https://github.com/mapbox/mapbox-gl-native/issues/6745",
Expand Down
6 changes: 3 additions & 3 deletions src/mbgl/text/placement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down