From 61159d943cfe21492d29c6da05deefa5de21a23c Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 18 May 2021 19:58:58 +0300 Subject: [PATCH] effects: Fix interpolated values for redirected animations If a redirected animation reaches the end, the timeline value will be 0, i.e. the interpolated() function has to return the from value, not `to`. BUG: 438368 --- src/libkwineffects/kwinanimationeffect.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/libkwineffects/kwinanimationeffect.cpp b/src/libkwineffects/kwinanimationeffect.cpp index ace4c27255..0c67d260a2 100644 --- a/src/libkwineffects/kwinanimationeffect.cpp +++ b/src/libkwineffects/kwinanimationeffect.cpp @@ -682,11 +682,7 @@ void AnimationEffect::postPaintScreen() float AnimationEffect::interpolated( const AniData &a, int i ) const { - if (a.startTime > clock()) - return a.from[i]; - if (!a.timeLine.done()) - return a.from[i] + a.timeLine.value() * (a.to[i] - a.from[i]); - return a.to[i]; // we're done and "waiting" at the target value + return a.from[i] + a.timeLine.value() * (a.to[i] - a.from[i]); } float AnimationEffect::progress( const AniData &a ) const