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

Commit

Permalink
[core] Do not try to place a center anchor beyond the center of the line
Browse files Browse the repository at this point in the history
Once the algorithm finds the center of the line, if placement is
not possible, do not place the anchor.

Previous code was trying to continue place the label beyond the center
of the segment.

Fixes #15139.
  • Loading branch information
tmpsantos committed Jul 19, 2019
1 parent 4a93f39 commit 2a12172
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mbgl/text/get_anchors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ optional<Anchor> getCenterAnchor(const GeometryCoordinates& line,
if (!angleWindowSize || checkMaxAngle(line, anchor, labelLength, angleWindowSize, maxAngle)) {
return anchor;
}

return nullopt;
}

prevDistance += segmentDistance;
Expand Down

0 comments on commit 2a12172

Please sign in to comment.