diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2014-08-05 18:04:31 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2014-08-20 13:58:37 -0700 |
commit | b9c7e1bdd99b4c6d37672ef34ffe178d4bc54ad3 (patch) | |
tree | d53d5f9068a3501bad712e8c0c3e999a25068297 /src/geometry/resample.cpp | |
parent | 2660b7bd1b77d9571ceb12adfef4b83e56d8e0f0 (diff) | |
download | qtlocation-mapboxgl-b9c7e1bdd99b4c6d37672ef34ffe178d4bc54ad3.tar.gz |
Consolidate duplicate interpolation definitions
While here, do not interpolate style properties that
are not transitionable. The previous behavior was to
switch from old to new value halfway through the transition;
now the new value is used immediately, as in JS.
Diffstat (limited to 'src/geometry/resample.cpp')
-rw-r--r-- | src/geometry/resample.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/geometry/resample.cpp b/src/geometry/resample.cpp index c40fc9bb0a..abb3ef1e3c 100644 --- a/src/geometry/resample.cpp +++ b/src/geometry/resample.cpp @@ -1,6 +1,6 @@ #include <mbgl/geometry/resample.hpp> -#include <mbgl/util/math.hpp> +#include <mbgl/util/interpolate.hpp> #include <cmath> @@ -43,7 +43,8 @@ Anchors resample(const std::vector<Coordinate> &vertices, float spacing, markedDistance += spacing; float t = (markedDistance - distance) / segmentDist, - x = util::interp(a.x, b.x, t), y = util::interp(a.y, b.y, t), + x = util::interpolate(a.x, b.x, t), + y = util::interpolate(a.y, b.y, t), s = minScales[added % len]; if (x >= 0 && x < 4096 && y >= 0 && y < 4096) { |