# HG changeset patch # User Thinker K.F. Li # Date 1284993823 -28800 # Node ID 88f4916a0691553ed562d6407ed0e3a8a59c1dd1 # Parent c385493e04b6dfa0a871a68f8ad74c47794eb222 Compute y position according center of lightbar and text diff -r c385493e04b6 -r 88f4916a0691 nodejs/animate.js --- 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); diff -r c385493e04b6 -r 88f4916a0691 nodejs/testdesktop.js --- 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);