gnome-shell r147 - trunk/js/ui
- From: danw svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-shell r147 - trunk/js/ui
- Date: Tue, 13 Jan 2009 20:49:31 +0000 (UTC)
Author: danw
Date: Tue Jan 13 20:49:31 2009
New Revision: 147
URL: http://svn.gnome.org/viewvc/gnome-shell?rev=147&view=rev
Log:
Make sure the animation always starts from the first frame, even if the
system is really busy and ClutterTimeline doesn't get a chance to call
us until it thinks several frames have passed
Modified:
trunk/js/ui/main.js
Modified: trunk/js/ui/main.js
==============================================================================
--- trunk/js/ui/main.js (original)
+++ trunk/js/ui/main.js Tue Jan 13 20:49:31 2009
@@ -64,8 +64,18 @@
// So by dynamically adjusting the value of FRAME_RATE we can trick
// it into dealing with dropped frames.
- let delta = frame - this._frame;
- if (delta == 0)
+ // If there is a lot of setup to start the animation, then
+ // first frame number we get from clutter might be a long ways
+ // into the animation (or the animation might even be done).
+ // That looks bad, so we always start one frame into the
+ // animation then only do frame dropping from there.
+ let delta;
+ if (this._frame == 0)
+ delta = 1;
+ else
+ delta = frame - this._frame;
+
+ if (delta == 0) // protect against divide-by-0 if we get a frame twice
this.FRAME_RATE = this.TARGET_FRAME_RATE;
else
this.FRAME_RATE = this.TARGET_FRAME_RATE / delta;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]