Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
use floats when resampling lines to match -js
Browse files Browse the repository at this point in the history
This fixes many small render test and collision differences.
  • Loading branch information
ansis committed May 29, 2015
1 parent ff6a5ce commit 520eddb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/mbgl/text/get_anchors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion styles
Submodule styles updated 1402 files

0 comments on commit 520eddb

Please sign in to comment.