diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-06-10 21:57:53 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-06-20 13:01:59 +0300 |
commit | 05ae0b5dfd6ea81f357360dc893aa1a78e02926a (patch) | |
tree | 52043296a71dddde68b0b53a85df5bac5e1f296c /src/mbgl/style/paint_property.hpp | |
parent | 5792091e9db92aefb3ff969d9059923fa03bb90e (diff) | |
download | qtlocation-mapboxgl-05ae0b5dfd6ea81f357360dc893aa1a78e02926a.tar.gz |
[core] Use default transition ease for style transition
Fixes #363.
Diffstat (limited to 'src/mbgl/style/paint_property.hpp')
-rw-r--r-- | src/mbgl/style/paint_property.hpp | 9 |
1 files changed, 5 insertions, 4 deletions
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 <mbgl/style/transition_options.hpp> #include <mbgl/style/cascade_parameters.hpp> #include <mbgl/style/calculation_parameters.hpp> +#include <mbgl/util/constants.hpp> #include <mbgl/util/interpolate.hpp> #include <mbgl/util/std.hpp> #include <mbgl/util/rapidjson.hpp> @@ -124,18 +125,18 @@ private: } Result calculate(const Evaluator<T>& evaluator, const TimePoint& now) { - Result final = PropertyValue<T>::visit(value, evaluator); + Result finalValue = PropertyValue<T>::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<float>(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)); } } |