diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp index c26ea5f2..5e3df81f 100644 --- a/src/managers/AnimationManager.cpp +++ b/src/managers/AnimationManager.cpp @@ -37,6 +37,11 @@ void CAnimationManager::tick() { DEFAULTBEZIER = m_mBezierCurves.find("default"); for (auto& av : m_lAnimatedVariables) { + + // first of all, check if we need to update it at all + if (!av->isBeingAnimated()) + continue; + // get speed const auto SPEED = *av->m_pSpeed == 0 ? *PANIMSPEED : *av->m_pSpeed; @@ -44,12 +49,6 @@ void CAnimationManager::tick() { const auto DURATIONPASSED = std::chrono::duration_cast(std::chrono::system_clock::now() - av->animationBegin).count(); const float SPENT = std::clamp((DURATIONPASSED / 100.f) / SPEED, 0.f, 1.f); - // first of all, check if we need to update it at all - if (SPENT >= 1.f) { - av->warp(); - continue; - } - // window stuff const auto PWINDOW = (CWindow*)av->m_pWindow; const auto PWORKSPACE = (CWorkspace*)av->m_pWorkspace; @@ -76,6 +75,11 @@ void CAnimationManager::tick() { break; } + if (SPENT >= 1.f) { + av->warp(); + break; + } + const auto DELTA = av->m_fGoal - av->m_fBegun; const auto BEZIER = m_mBezierCurves.find(*av->m_pBezier); @@ -92,6 +96,11 @@ void CAnimationManager::tick() { break; } + if (SPENT >= 1.f) { + av->warp(); + break; + } + const auto DELTA = av->m_vGoal - av->m_vBegun; const auto BEZIER = m_mBezierCurves.find(*av->m_pBezier); @@ -108,6 +117,11 @@ void CAnimationManager::tick() { break; } + if (SPENT >= 1.f) { + av->warp(); + break; + } + const auto DELTA = av->m_cGoal - av->m_cBegun; const auto BEZIER = m_mBezierCurves.find(*av->m_pBezier);