Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 8593823f authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

[effects/fallapart] Fade out window parts

Summary:
Window parts disappear very rapidly, it feels not really pleasant.
Animate also opacity so window parts disappear over time. This
makes fall apart animation more pleasant.

### Before

{F5912359}

### After

{F5912360}

Test Plan:
* Enabled fall apart effect
* Closed System Settings

Reviewers: #kwin, #plasma, #vdg, davidedmundson

Reviewed By: #kwin, #plasma, #vdg, davidedmundson

Subscribers: ngraham, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13528
parent 9260b3c5
......@@ -74,6 +74,7 @@ void FallApartEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& data,
void FallApartEffect::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data)
{
if (windows.contains(w) && isRealWindow(w)) {
const qreal t = windows[w];
WindowQuadList new_quads;
int cnt = 0;
foreach (WindowQuad quad, data.quads) { // krazy:exclude=foreach
......@@ -90,7 +91,7 @@ void FallApartEffect::paintWindow(EffectWindow* w, int mask, QRegion region, Win
ydiff = -(w->height() / 2 - p1.y()) / w->height() * 100;
if (p1.y() > w->height() / 2)
ydiff = (p1.y() - w->height() / 2) / w->height() * 100;
double modif = windows[ w ] * windows[ w ] * 64;
double modif = t * t * 64;
srandom(cnt); // change direction randomly but consistently
xdiff += (rand() % 21 - 10);
ydiff += (rand() % 21 - 10);
......@@ -119,6 +120,7 @@ void FallApartEffect::paintWindow(EffectWindow* w, int mask, QRegion region, Win
++cnt;
}
data.quads = new_quads;
data.multiplyOpacity(interpolate(1.0, 0.0, t));
}
effects->paintWindow(w, mask, region, data);
}
......
Markdown is supported
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