diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-06-21 11:39:02 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-06-26 09:42:35 -0700 |
commit | 150fc6b643e0f10d2fb98d056ee4ea6a159596fb (patch) | |
tree | 2070c5fd557158437d3f565f7c4256091eca65de /src/mbgl/style/properties.hpp | |
parent | c3900e42d6b58eeb14c3246528f0517229bd51b9 (diff) | |
download | qtlocation-mapboxgl-150fc6b643e0f10d2fb98d056ee4ea6a159596fb.tar.gz |
[core] Don't transition new layers on a setStyle operation
Diffstat (limited to 'src/mbgl/style/properties.hpp')
-rw-r--r-- | src/mbgl/style/properties.hpp | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/mbgl/style/properties.hpp b/src/mbgl/style/properties.hpp index e42beac97a..dfcf7993a7 100644 --- a/src/mbgl/style/properties.hpp +++ b/src/mbgl/style/properties.hpp @@ -20,6 +20,10 @@ class Transitioning { public: Transitioning() = default; + explicit Transitioning(Value value_) + : value(std::move(value_)) { + } + Transitioning(Value value_, Transitioning<Value> prior_, TransitionOptions transition, @@ -125,7 +129,10 @@ public: class Evaluated : public Tuple<EvaluatedTypes> { public: - using Tuple<EvaluatedTypes>::Tuple; + template <class... Us> + Evaluated(Us&&... us) + : Tuple<EvaluatedTypes>(std::forward<Us>(us)...) { + } }; class PossiblyEvaluated : public Tuple<PossiblyEvaluatedTypes> { @@ -169,7 +176,10 @@ public: class Unevaluated : public Tuple<UnevaluatedTypes> { public: - using Tuple<UnevaluatedTypes>::Tuple; + template <class... Us> + Unevaluated(Us&&... us) + : Tuple<UnevaluatedTypes>(std::forward<Us>(us)...) { + } bool hasTransition() const { bool result = false; @@ -200,15 +210,24 @@ public: class Transitionable : public Tuple<TransitionableTypes> { public: - using Tuple<TransitionableTypes>::Tuple; + template <class... Us> + Transitionable(Us&&... us) + : Tuple<TransitionableTypes>(std::forward<Us>(us)...) { + } - Unevaluated transition(const TransitionParameters& parameters, Unevaluated&& prior) const { + Unevaluated transitioned(const TransitionParameters& parameters, Unevaluated&& prior) const { return Unevaluated { this->template get<Ps>() .transition(parameters, std::move(prior.template get<Ps>()))... }; } + Unevaluated untransitioned() const { + return Unevaluated { + typename Ps::UnevaluatedType(this->template get<Ps>().value)... + }; + } + bool hasDataDrivenPropertyDifference(const Transitionable& other) const { bool result = false; util::ignore({ (result |= this->template get<Ps>().value.hasDataDrivenPropertyDifference(other.template get<Ps>().value))... }); |