From c36b99cdbc65e45f91ee93c016664a39d79c159a Mon Sep 17 00:00:00 2001 From: Vlad Zagorodniy Date: Thu, 2 Aug 2018 15:02:36 +0300 Subject: [PATCH] [effects/minimizeanimation] Make it a little bit smoother Summary: Don't cast translation values from double to int because it makes animation a little bit choppy. It makes significant difference only when animation speed is set to "Very slow". Test Plan: - Go to 'System Settins > Display and Monitor > Compositor'; - Set animation speed to "Very slow"(it scales animation durations by 20x); - Minimize/uniminimize System Settings. Reviewers: #kwin, davidedmundson Reviewed By: #kwin, davidedmundson Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D14552 --- effects/minimizeanimation/minimizeanimation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/effects/minimizeanimation/minimizeanimation.cpp b/effects/minimizeanimation/minimizeanimation.cpp index 4a4518cadf..d22c1f3776 100644 --- a/effects/minimizeanimation/minimizeanimation.cpp +++ b/effects/minimizeanimation/minimizeanimation.cpp @@ -91,8 +91,8 @@ void MinimizeAnimationEffect::paintWindow(EffectWindow* w, int mask, QRegion reg data *= QVector2D(interpolate(1.0, icon.width() / (double)geo.width(), progress), interpolate(1.0, icon.height() / (double)geo.height(), progress)); - data.setXTranslation((int)interpolate(data.xTranslation(), icon.x() - geo.x(), progress)); - data.setYTranslation((int)interpolate(data.yTranslation(), icon.y() - geo.y(), progress)); + data.setXTranslation(interpolate(data.xTranslation(), icon.x() - geo.x(), progress)); + data.setYTranslation(interpolate(data.yTranslation(), icon.y() - geo.y(), progress)); data.multiplyOpacity(0.1 + (1 - progress) * 0.9); }