changeset 856:88f4916a0691 abs_n_rel_center

Compute y position according center of lightbar and text
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 20 Sep 2010 22:43:43 +0800
parents c385493e04b6
children ea1e88c40548
files nodejs/animate.js nodejs/testdesktop.js
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/nodejs/animate.js	Mon Sep 20 22:43:43 2010 +0800
+++ b/nodejs/animate.js	Mon Sep 20 22:43:43 2010 +0800
@@ -66,6 +66,9 @@
     var obj = this._obj;
     var self = this;
     
+    if(obj.timer)
+	obj.timer.stop();
+
     this._start_mtx = [obj[0], obj[1], obj[2], obj[3], obj[4], obj[5]];
     this._start_tm = Date.now();
     obj.timer = setInterval(function() { self.draw(); }, frame_interval);
--- a/nodejs/testdesktop.js	Mon Sep 20 22:43:43 2010 +0800
+++ b/nodejs/testdesktop.js	Mon Sep 20 22:43:43 2010 +0800
@@ -77,8 +77,7 @@
 	return;
     }
     var target = lines[line];
-    sys.puts(target);
-    var sy = target.cnter.y - 20 - lightbar.center.y;
+    var sy = target.center.y - lightbar.center.y;
     sys.puts("line="+line);
     sys.puts("sy="+sy);
     sys.puts("target.y="+target.center.y);