From 667532357b0de7299dd0ddbe1df8859a1a06e52f Mon Sep 17 00:00:00 2001 From: Daria Volvenkova Date: Fri, 6 May 2016 14:39:17 +0300 Subject: [PATCH] Fixed follow animation after the start of navigation. --- drape_frontend/animation_system.cpp | 7 ++++++- drape_frontend/animation_system.hpp | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drape_frontend/animation_system.cpp b/drape_frontend/animation_system.cpp index 8b31d874e1..a2a74a2b48 100644 --- a/drape_frontend/animation_system.cpp +++ b/drape_frontend/animation_system.cpp @@ -987,7 +987,7 @@ void AnimationSystem::CombineAnimation(drape_ptr animation) { for (auto & lst : m_animationChain) { - bool couldBeBlended = true; + bool couldBeBlended = animation->CouldBeBlended(); for (auto it = lst.begin(); it != lst.end();) { auto & anim = *it; @@ -1013,12 +1013,17 @@ void AnimationSystem::CombineAnimation(drape_ptr animation) ++it; } } + if (couldBeBlended) { animation->OnStart(); lst.emplace_back(move(animation)); return; } + else if (m_animationChain.size() > 1 && animation->CouldBeInterrupted()) + { + return; + } } PushAnimation(move(animation)); } diff --git a/drape_frontend/animation_system.hpp b/drape_frontend/animation_system.hpp index f1afc959ac..e61162a166 100644 --- a/drape_frontend/animation_system.hpp +++ b/drape_frontend/animation_system.hpp @@ -134,6 +134,7 @@ public: void SetOnFinishAction(TAction const & action) { m_onFinishAction = action; } void SetOnInterruptAction(TAction const & action) { m_onInterruptAction = action; } + bool CouldBeBlended() const { return m_couldBeBlended; } bool CouldBeInterrupted() const { return m_couldBeInterrupted; } bool CouldBeBlendedWith(Animation const & animation) const;