[core] Do not try to place a center anchor beyond the center of the line
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.
This commit is contained in:
@@ -166,6 +166,8 @@ optional<Anchor> getCenterAnchor(const GeometryCoordinates& line,
|
||||
if (!angleWindowSize || checkMaxAngle(line, anchor, labelLength, angleWindowSize, maxAngle)) {
|
||||
return anchor;
|
||||
}
|
||||
|
||||
return nullopt;
|
||||
}
|
||||
|
||||
prevDistance += segmentDistance;
|
||||
|
||||
Reference in New Issue
Block a user