summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnsis Brammanis <ansis@mapbox.com>2019-10-23 17:21:38 -0400
committerDane Springmeyer <dane@mapbox.com>2019-10-24 13:13:56 -0700
commit969e7d26f43706191be4e75e07025fa25b6cbd53 (patch)
treeefa23e34ad1e120d16f617105b02e9127f36ef6e
parentdb9bf9386785b65e770d526e5c492c84b95e931d (diff)
downloadqtlocation-mapboxgl-969e7d26f43706191be4e75e07025fa25b6cbd53.tar.gz
[core] avoid edges for labels that use text-variable-anchors
to prevent clipped labels in rendered image tiles.
-rw-r--r--src/mbgl/text/placement.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mbgl/text/placement.cpp b/src/mbgl/text/placement.cpp
index 8b0a3975fc..7343f19aea 100644
--- a/src/mbgl/text/placement.cpp
+++ b/src/mbgl/text/placement.cpp
@@ -164,12 +164,12 @@ void Placement::placeBucket(
auto partiallyEvaluatedIconSize = bucket.iconSizeBinder->evaluateForZoom(state.getZoom());
optional<CollisionTileBoundaries> avoidEdges;
- if (mapMode == MapMode::Tile &&
- (layout.get<style::SymbolAvoidEdges>() ||
- layout.get<style::SymbolPlacement>() == style::SymbolPlacementType::Line)) {
+ if (mapMode == MapMode::Tile && (layout.get<style::SymbolAvoidEdges>() ||
+ layout.get<style::SymbolPlacement>() == style::SymbolPlacementType::Line ||
+ !layout.get<style::TextVariableAnchor>().empty())) {
avoidEdges = collisionIndex.projectTileBoundaries(posMatrix);
}
-
+
const bool textAllowOverlap = layout.get<style::TextAllowOverlap>();
const bool iconAllowOverlap = layout.get<style::IconAllowOverlap>();
// This logic is similar to the "defaultOpacityState" logic below in updateBucketOpacities