Mercurial > MadButterfly
comparison nodejs/animate.js @ 937:191d3a5f74c8
Migrate testsvg.js to new interface of shift action.
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Fri, 12 Nov 2010 16:54:48 +0800 |
parents | d35f9702b8c2 |
children | 4072a302b207 |
comparison
equal
deleted
inserted
replaced
936:a9abcdac0ae5 | 937:191d3a5f74c8 |
---|---|
13 var x, y; | 13 var x, y; |
14 | 14 |
15 x = (this.targetx - this.startposx) * percent + this.startposx; | 15 x = (this.targetx - this.startposx) * percent + this.startposx; |
16 y = (this.targety - this.startposy) * percent + this.startposy; | 16 y = (this.targety - this.startposy) * percent + this.startposy; |
17 this.obj.center.move(x, y); | 17 this.obj.center.move(x, y); |
18 this.app.refresh(); | 18 this._app.refresh(); |
19 } | 19 } |
20 | 20 |
21 function shift(app,obj,shiftx,shifty) { | 21 function shift(app,obj,shiftx,shifty) { |
22 obj.animated_shift = this; | 22 obj.animated_shift = this; |
23 this.app = app; | 23 this._app = app; |
24 this.obj = obj; | 24 this.obj = obj; |
25 this.end = 0; | 25 this.end = 0; |
26 this.targetx = shiftx + obj.center.x; | 26 this.targetx = shiftx + obj.center.x; |
27 this.targety = shifty + obj.center.y; | 27 this.targety = shifty + obj.center.y; |
28 this.startposx = obj.center.x; | 28 this.startposx = obj.center.x; |