From 1f798485b91784c0e02e0b8e073d5e448da8123d Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Fri, 10 Dec 2021 16:47:04 +0200 Subject: [PATCH] effects/scale: Tune animation params Use standard easing curves in animations. OutCubic for the intro animation and the InCubic for the outro animation. Hidden opacity options were removed because I don't think they are needed anymore. I made the starting opacity 0.4 to make the animation look closer to what it would have been with an ease-out curve without realizing it. --- src/effects/scale/package/contents/code/main.js | 16 +++++++--------- .../scale/package/contents/config/main.xml | 14 ++------------ 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/src/effects/scale/package/contents/code/main.js b/src/effects/scale/package/contents/code/main.js index 0cb9487235..ef6e3a526b 100644 --- a/src/effects/scale/package/contents/code/main.js +++ b/src/effects/scale/package/contents/code/main.js @@ -30,13 +30,11 @@ class ScaleEffect { } loadConfig() { - const defaultDuration = 160; + const defaultDuration = 200; const duration = effect.readConfig("Duration", defaultDuration) || defaultDuration; this.duration = animationTime(duration); - this.inScale = effect.readConfig("InScale", 0.96); - this.inOpacity = effect.readConfig("InOpacity", 0.4); - this.outScale = effect.readConfig("OutScale", 0.96); - this.outOpacity = effect.readConfig("OutOpacity", 0.0); + this.inScale = effect.readConfig("InScale", 0.8); + this.outScale = effect.readConfig("OutScale", 0.8); } static isScaleWindow(window) { @@ -104,7 +102,7 @@ class ScaleEffect { this.setupForcedRoles(window); window.scaleInAnimation = animate({ window: window, - curve: QEasingCurve.InOutSine, + curve: QEasingCurve.OutCubic, duration: this.duration, animations: [ { @@ -113,7 +111,7 @@ class ScaleEffect { }, { type: Effect.Opacity, - from: this.inOpacity + from: 0 } ] }); @@ -139,7 +137,7 @@ class ScaleEffect { this.setupForcedRoles(window); window.scaleOutAnimation = animate({ window: window, - curve: QEasingCurve.InOutSine, + curve: QEasingCurve.InCubic, duration: this.duration, animations: [ { @@ -148,7 +146,7 @@ class ScaleEffect { }, { type: Effect.Opacity, - to: this.outOpacity + to: 0 } ] }); diff --git a/src/effects/scale/package/contents/config/main.xml b/src/effects/scale/package/contents/config/main.xml index 4f9152a087..20ec056080 100644 --- a/src/effects/scale/package/contents/config/main.xml +++ b/src/effects/scale/package/contents/config/main.xml @@ -9,20 +9,10 @@ 0 - 0.96 - - - 0.4 - 0.0 - 1.0 + 0.8 - 0.96 - - - 0.0 - 0.0 - 1.0 + 0.8