summaryrefslogtreecommitdiff
path: root/src/managers/AnimationManager.cpp
diff options
context:
space:
mode:
authorMaximilian Seidler <78690852+PaideiaDilemma@users.noreply.github.com>2025-01-09 11:13:47 +0000
committerGitHub <noreply@github.com>2025-01-09 11:13:47 +0000
commite66eab7b6a90514251439f661454c536afa3e5c8 (patch)
treef174983b656a7fb98e5e242ddd6bcf4db8ff85de /src/managers/AnimationManager.cpp
parentc9822b08f914da2997e8ef47c8bef8016e5ff313 (diff)
animationmgr: don't warp based on POINTY value (#9000)
Diffstat (limited to 'src/managers/AnimationManager.cpp')
-rw-r--r--src/managers/AnimationManager.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp
index c1ea1d27..f0f6a980 100644
--- a/src/managers/AnimationManager.cpp
+++ b/src/managers/AnimationManager.cpp
@@ -40,7 +40,7 @@ CHyprAnimationManager::CHyprAnimationManager() {
template <Animable VarType>
void updateVariable(CAnimatedVariable<VarType>& av, const float POINTY, bool warp = false) {
- if (POINTY >= 1.f || warp || av.value() == av.goal()) {
+ if (warp || av.value() == av.goal()) {
av.warp();
return;
}
@@ -50,7 +50,7 @@ void updateVariable(CAnimatedVariable<VarType>& av, const float POINTY, bool war
}
void updateColorVariable(CAnimatedVariable<CHyprColor>& av, const float POINTY, bool warp) {
- if (POINTY >= 1.f || warp || av.value() == av.goal()) {
+ if (warp || av.value() == av.goal()) {
av.warp();
return;
}
@@ -146,11 +146,12 @@ static void handleUpdate(CAnimatedVariable<VarType>& av, bool warp) {
const auto SPENT = av.getPercent();
const auto PBEZIER = g_pAnimationManager->getBezier(av.getBezierName());
const auto POINTY = PBEZIER->getYForPoint(SPENT);
+ const bool WARP = animationsDisabled || SPENT >= 1.f;
if constexpr (std::same_as<VarType, CHyprColor>)
- updateColorVariable(av, POINTY, animationsDisabled);
+ updateColorVariable(av, POINTY, WARP);
else
- updateVariable<VarType>(av, POINTY, animationsDisabled);
+ updateVariable<VarType>(av, POINTY, WARP);
av.onUpdate();