summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnsis Brammanis <brammanis@gmail.com>2015-05-29 11:51:10 -0400
committerAnsis Brammanis <brammanis@gmail.com>2015-05-29 11:51:10 -0400
commit520eddb794e616490c0e58c2f210f338537be82b (patch)
treeadeddee5fbde85c9605f2053b36b980c1cb1b1b1
parentff6a5ce5bc674e17a24c3f18b305d5dd2f0e21b0 (diff)
downloadqtlocation-mapboxgl-520eddb794e616490c0e58c2f210f338537be82b.tar.gz
use floats when resampling lines to match -js
This fixes many small render test and collision differences.
-rw-r--r--src/mbgl/text/get_anchors.cpp6
m---------styles0
2 files changed, 3 insertions, 3 deletions
diff --git a/src/mbgl/text/get_anchors.cpp b/src/mbgl/text/get_anchors.cpp
index c5aa6e9623..88c09983a6 100644
--- a/src/mbgl/text/get_anchors.cpp
+++ b/src/mbgl/text/get_anchors.cpp
@@ -28,11 +28,11 @@ Anchors resample(const std::vector<Coordinate> &line, const float offset, const
markedDistance += spacing;
float t = (markedDistance - distance) / segmentDist,
- x = util::interpolate(a.x, b.x, t),
- y = util::interpolate(a.y, b.y, t);
+ x = util::interpolate(float(a.x), float(b.x), t),
+ y = util::interpolate(float(a.y), float(b.y), t);
if (x >= 0 && x < 4096 && y >= 0 && y < 4096) {
- Anchor anchor(x, y, angle, 0.5f, i);
+ Anchor anchor(std::round(x), std::round(y), angle, 0.5f, i);
if (!angleWindowSize || checkMaxAngle(line, anchor, labelLength, angleWindowSize, maxAngle)) {
anchors.push_back(anchor);
diff --git a/styles b/styles
-Subproject 93a23d762332a4c75e3dae1c547c4d810101e97
+Subproject 86aecb8e997c54c9d2bf6ac494fea132e375ad0