js: Use implicit animations for animatable properties
We now have everything in place to replace Tweener for all animatable properties with implicit animations, which has the following benefits: - they run entirely in C, while Tweener requires context switches to JS each frame - they are more reliable, as Tweener only detects when an animation is overwritten with another Tween, while Clutter considers any property change https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22
This commit is contained in:
@ -168,16 +168,16 @@ var Lightbox = class Lightbox {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Tweener.removeTweens(this.actor);
|
||||
Tweener.addTween(this.actor,
|
||||
{ opacity: 255 * this._fadeFactor,
|
||||
time: fadeInTime / 1000,
|
||||
transition: 'easeOutQuad',
|
||||
onComplete: () => {
|
||||
this.shown = true;
|
||||
this.emit('shown');
|
||||
}
|
||||
});
|
||||
this.actor.remove_all_transitions();
|
||||
this.actor.ease({
|
||||
opacity: 255 * this._fadeFactor,
|
||||
duration: fadeInTime,
|
||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||
onComplete: () => {
|
||||
this.shown = true;
|
||||
this.emit('shown');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.actor.show();
|
||||
@ -202,15 +202,15 @@ var Lightbox = class Lightbox {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Tweener.removeTweens(this.actor);
|
||||
Tweener.addTween(this.actor,
|
||||
{ opacity: 0,
|
||||
time: fadeOutTime / 1000,
|
||||
transition: 'easeOutQuad',
|
||||
onComplete: () => {
|
||||
this.actor.hide();
|
||||
}
|
||||
});
|
||||
this.actor.remove_all_transitions();
|
||||
this.actor.ease({
|
||||
opacity: 0,
|
||||
duration: fadeOutTime,
|
||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||
onComplete: () => {
|
||||
this.actor.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user