gjs r143 - in trunk: modules/tweener test/js
- From: hp svn gnome org
- To: svn-commits-list gnome org
- Subject: gjs r143 - in trunk: modules/tweener test/js
- Date: Tue, 20 Jan 2009 18:20:03 +0000 (UTC)
Author: hp
Date: Tue Jan 20 18:20:03 2009
New Revision: 143
URL: http://svn.gnome.org/viewvc/gjs?rev=143&view=rev
Log:
fix testTweener by syncing to new tweener API
Modified:
trunk/modules/tweener/tweener.js
trunk/test/js/testTweener.js
Modified: trunk/modules/tweener/tweener.js
==============================================================================
--- trunk/modules/tweener/tweener.js (original)
+++ trunk/modules/tweener/tweener.js Tue Jan 20 18:20:03 2009
@@ -77,7 +77,7 @@
let me = this;
this._timeoutID =
- Mainloop.timeout_add(Math.floor(1000 / 65),
+ Mainloop.timeout_add(Math.floor(1000 / me.FRAME_RATE),
function() {
me._currentTime += 1000 / me.FRAME_RATE;
me.emit('prepare-frame');
Modified: trunk/test/js/testTweener.js
==============================================================================
--- trunk/test/js/testTweener.js (original)
+++ trunk/test/js/testTweener.js Tue Jan 20 18:20:03 2009
@@ -5,21 +5,35 @@
// Set up Tweener to have a "frame pulse" from
// our main rendering loop
let ticker = {
- FRAME_RATE : 50,
+ FRAME_RATE: 50,
+
+ _init : function() {
+ },
+
start : function() {
+ this._currentTime = 0;
+
let me = this;
- this._id =
- Mainloop.timeout_add(1000/this.FRAME_RATE,
+ this._timeoutID =
+ Mainloop.timeout_add(Math.floor(1000 / me.FRAME_RATE),
function() {
+ me._currentTime += 1000 / me.FRAME_RATE;
me.emit('prepare-frame');
return true;
});
},
+
stop : function() {
- if (this._id) {
- Mainloop.source_remove(this._id);
- this._id = 0;
+ if ('_timeoutID' in this) {
+ Mainloop.source_remove(this._timeoutID);
+ delete this._timeoutID;
}
+
+ this._currentTime = 0;
+ },
+
+ getTime : function() {
+ return this._currentTime;
}
};
imports.signals.addSignalMethods(ticker);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]