diff options
author | Florian Müllner <fmuellner@gnome.org> | 2017-06-10 05:55:10 +0200 |
---|---|---|
committer | Florian Müllner <fmuellner@gnome.org> | 2018-07-14 20:34:42 +0200 |
commit | d1c3471b5fb404a7b9100a76904d62ac891c912d (patch) | |
tree | c28a245dc22b5a3839a276b396248e49db0c0f23 | |
parent | 29364589e1b50c8864c6dccf0f091c5d8e12303a (diff) | |
download | gnome-shell-wip/fmuellner/ease-actors.tar.gz |
layout: Split ripple animationwip/fmuellner/ease-actors
Similar to the previous patch, splitting the existing tween into two
allows us to use implicit animations.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22
-rw-r--r-- | js/ui/layout.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/js/ui/layout.js b/js/ui/layout.js index 210fb667a..d970439ca 100644 --- a/js/ui/layout.js +++ b/js/ui/layout.js @@ -1199,12 +1199,10 @@ var HotCorner = new Lang.Class({ // We draw a ripple by using a source image and animating it scaling // outwards and fading away. We want the ripples to move linearly // or it looks unrealistic, but if the opacity of the ripple goes - // linearly to zero it fades away too quickly, so we use Tweener's - // 'onUpdate' to give a non-linear curve to the fade-away and make + // linearly to zero it fades away too quickly, so we use a separate + // tween to give a non-linear curve to the fade-away and make // it more visible in the middle section. - ripple._opacity = startOpacity; - if (ripple.get_text_direction() == Clutter.TextDirection.RTL) ripple.set_anchor_point_from_gravity(Clutter.Gravity.NORTH_EAST); @@ -1215,14 +1213,16 @@ var HotCorner = new Lang.Class({ ripple.x = this._x; ripple.y = this._y; - Tweener.addTween(ripple, { _opacity: 0, - scale_x: finalScale, + Tweener.addTween(ripple, { opacity: 0, + delay: delay, + time: time, + transition: 'easeInQuad' }); + Tweener.addTween(ripple, { scale_x: finalScale, scale_y: finalScale, delay: delay, time: time, transition: 'linear', - onUpdate() { ripple.opacity = 255 * Math.sqrt(ripple._opacity); }, - onComplete() { ripple.visible = false; } }); + onComplete: function() { ripple.visible = false; } }); }, _rippleAnimation() { |