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

Commit

Permalink
[core] avoid edges for labels that use text-variable-anchors
Browse files Browse the repository at this point in the history
to prevent clipped labels in rendered image tiles.
  • Loading branch information
ansis authored and pozdnyakov committed Oct 24, 2019
1 parent 744102d commit 4fb75ba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mbgl/text/placement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4fb75ba

Please sign in to comment.