Commit c36b99cd authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

[effects/minimizeanimation] Make it a little bit smoother

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:
parent 386d6436
......@@ -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);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment