use floats when resampling lines to match -js

This fixes many small render test and collision differences.
This commit is contained in:
Ansis Brammanis
2015-05-29 11:51:10 -04:00
parent ff6a5ce5bc
commit 520eddb794
2 changed files with 4 additions and 4 deletions

View File

@@ -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);

2
styles

Submodule styles updated: 93a23d7623...86aecb8e99