summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2019-07-19 13:39:46 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2019-07-19 15:17:00 +0200
commitfe9d4636586d7451aa7e5a7ecbee62b67720032a (patch)
treeb7462472bf08f0d4324d423d4a227d415b00c971
parentd7f28c3079294242578f5c812b230b2c344e20ff (diff)
downloadqtlocation-mapboxgl-fe9d4636586d7451aa7e5a7ecbee62b67720032a.tar.gz
[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.
-rw-r--r--src/mbgl/text/get_anchors.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mbgl/text/get_anchors.cpp b/src/mbgl/text/get_anchors.cpp
index 160ee21edf..c38e181181 100644
--- a/src/mbgl/text/get_anchors.cpp
+++ b/src/mbgl/text/get_anchors.cpp
@@ -166,6 +166,8 @@ optional<Anchor> getCenterAnchor(const GeometryCoordinates& line,
if (!angleWindowSize || checkMaxAngle(line, anchor, labelLength, angleWindowSize, maxAngle)) {
return anchor;
}
+
+ return nullopt;
}
prevDistance += segmentDistance;