summaryrefslogtreecommitdiff
path: root/src/mbgl
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl')
-rw-r--r--src/mbgl/geometry/anchor.hpp5
-rw-r--r--src/mbgl/text/get_anchors.cpp8
2 files changed, 6 insertions, 7 deletions
diff --git a/src/mbgl/geometry/anchor.hpp b/src/mbgl/geometry/anchor.hpp
index 1a2cbd3dac..f29796bf48 100644
--- a/src/mbgl/geometry/anchor.hpp
+++ b/src/mbgl/geometry/anchor.hpp
@@ -11,11 +11,10 @@ class Anchor {
public:
Point<float> point;
float angle = 0.0f;
- float scale = 0.0f;
optional<std::size_t> segment;
- Anchor(float x_, float y_, float angle_, float scale_, optional<std::size_t> segment_ = nullopt)
- : point(x_, y_), angle(angle_), scale(scale_), segment(segment_) {}
+ Anchor(float x_, float y_, float angle_, optional<std::size_t> segment_ = nullopt)
+ : point(x_, y_), angle(angle_), segment(segment_) {}
};
using Anchors = std::vector<Anchor>;
diff --git a/src/mbgl/text/get_anchors.cpp b/src/mbgl/text/get_anchors.cpp
index a2401a020a..714bc79fea 100644
--- a/src/mbgl/text/get_anchors.cpp
+++ b/src/mbgl/text/get_anchors.cpp
@@ -61,7 +61,7 @@ static Anchors resample(const GeometryCoordinates& line,
if (x >= 0 && x < util::EXTENT && y >= 0 && y < util::EXTENT &&
markedDistance - halfLabelLength >= 0.0f &&
markedDistance + halfLabelLength <= lineLength) {
- Anchor anchor(::round(x), ::round(y), angle, 0.5f, i);
+ Anchor anchor(::round(x), ::round(y), angle, i);
if (!angleWindowSize || checkMaxAngle(line, anchor, labelLength, angleWindowSize, maxAngle)) {
anchors.push_back(anchor);
@@ -160,9 +160,9 @@ optional<Anchor> getCenterAnchor(const GeometryCoordinates& line,
float t = (centerDistance - prevDistance) / segmentDistance,
x = util::interpolate(float(a.x), float(b.x), t),
y = util::interpolate(float(a.y), float(b.y), t);
-
- Anchor anchor(::round(x), ::round(y), util::angle_to(b, a), 0.5f, i);
-
+
+ Anchor anchor(::round(x), ::round(y), util::angle_to(b, a), i);
+
if (!angleWindowSize || checkMaxAngle(line, anchor, labelLength, angleWindowSize, maxAngle)) {
return anchor;
}