[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
This commit is contained in:
Vlad Zagorodniy 2018-08-02 15:02:36 +03:00
parent 386d64368d
commit c36b99cdbc

View file

@ -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);
}