[gnome-shell/wip/message-tray] messageTray: keep the desktop clone at integral positions tweening it
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/message-tray] messageTray: keep the desktop clone at integral positions tweening it
- Date: Wed, 15 Aug 2012 23:30:56 +0000 (UTC)
commit b378be569e5ae3fb3dfd2bbcede7b288d6ca1d6d
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Wed Aug 15 19:21:33 2012 -0400
messageTray: keep the desktop clone at integral positions tweening it
Drawing the desktop at non-integral positions is slower because it
turns off the obscured-area clipping logic, so avoid that.
js/ui/messageTray.js | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 44165cc..fa1cc7e 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1894,12 +1894,14 @@ const MessageTray = new Lang.Class({
this._lightbox.show();
+ this._desktopClone._progress = 0;
Tweener.addTween(this._desktopClone,
- { y: this._desktopClone.y - this.actor.height,
+ { _progress: this.actor.height,
time: ANIMATION_TIME,
transition: 'easeOutQuad',
onUpdate: Lang.bind(this, function() {
- let progress = -1 * this._desktopClone.y; // y is negative
+ let progress = Math.round(this._desktopClone._progress);
+ this._desktopClone.y = - progress;
this._desktopClone.set_clip(geometry.x,
geometry.y + progress,
geometry.width,
@@ -1928,8 +1930,9 @@ const MessageTray = new Lang.Class({
}
let geometry = this._desktopClone.clip;
+ this._desktopClone._progress = 0;
Tweener.addTween(this._desktopClone,
- { y: this._desktopClone.y + this.actor.height,
+ { _progress: this.actor.height,
time: ANIMATION_TIME,
transition: 'easeOutQuad',
onComplete: Lang.bind(this, function() {
@@ -1937,7 +1940,8 @@ const MessageTray = new Lang.Class({
this._desktopClone = null;
}),
onUpdate: Lang.bind(this, function() {
- let progress = this.actor.height + this._desktopClone.y; // y is negative
+ let progress = Math.round(this._desktopClone._progress);
+ this._desktopClone.y = progress - this.actor.height;
this._desktopClone.set_clip(geometry.x,
geometry.y - progress,
geometry.width,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]