From 05ae0b5dfd6ea81f357360dc893aa1a78e02926a Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Fri, 10 Jun 2016 21:57:53 +0300 Subject: [core] Use default transition ease for style transition Fixes #363. --- src/mbgl/style/paint_property.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mbgl/style/paint_property.hpp') diff --git a/src/mbgl/style/paint_property.hpp b/src/mbgl/style/paint_property.hpp index 67aa2244ec..7bb2e68b80 100644 --- a/src/mbgl/style/paint_property.hpp +++ b/src/mbgl/style/paint_property.hpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -124,18 +125,18 @@ private: } Result calculate(const Evaluator& evaluator, const TimePoint& now) { - Result final = PropertyValue::visit(value, evaluator); + Result finalValue = PropertyValue::visit(value, evaluator); if (!prior) { // No prior value. - return final; + return finalValue; } else if (now >= end) { // Transition from prior value is now complete. prior.reset(); - return final; + return finalValue; } else { // Interpolate between recursively-calculated prior value and final. float t = std::chrono::duration(now - begin) / (end - begin); - return util::interpolate(prior->calculate(evaluator, now), final, t); + return util::interpolate(prior->calculate(evaluator, now), finalValue, util::DEFAULT_TRANSITION_EASE.solve(t, 0.001)); } } -- cgit v1.2.1