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 14:22:26 +0200
commit2a121729563859fe360fe73ba7b31a54c25cc01e (patch)
treea5453793fc7596a387ccc3bafcaf40ea9714686d
parent4a93f39700d455ee37f1b212adf7d4648cde137c (diff)
downloadqtlocation-mapboxgl-2a121729563859fe360fe73ba7b31a54c25cc01e.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;