use floats when resampling lines to match -js
This fixes many small render test and collision differences.
This commit is contained in:
@@ -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
2
styles
Submodule styles updated: 93a23d7623...86aecb8e99
Reference in New Issue
Block a user