[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:
Thiago Marcos P. Santos
2019-07-19 13:39:46 +02:00
parent d7f28c3079
commit fe9d463658

View File

@@ -166,6 +166,8 @@ optional<Anchor> getCenterAnchor(const GeometryCoordinates& line,
if (!angleWindowSize || checkMaxAngle(line, anchor, labelLength, angleWindowSize, maxAngle)) {
return anchor;
}
return nullopt;
}
prevDistance += segmentDistance;