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.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user