added throttling unit tests

This commit is contained in:
Eric Rowell
2012-04-28 11:41:58 -07:00
parent 3200a9063a
commit 3ac0e5592e
5 changed files with 34 additions and 16 deletions

View File

@@ -40,7 +40,7 @@ Kinetic.GlobalObject = {
}
},
_addAnimation: function(anim) {
anim.id = Kinetic.GlobalObject.animIdCounter++;
anim.id = this.animIdCounter++;
this.animations.push(anim);
},
_removeAnimation: function(id) {
@@ -53,14 +53,13 @@ Kinetic.GlobalObject = {
}
},
_pullNodes: function(stage) {
var go = Kinetic.GlobalObject;
var tempNodes = go.tempNodes;
var tempNodes = this.tempNodes;
for(var n = 0; n < tempNodes.length; n++) {
var node = tempNodes[n];
if(node.getStage() !== undefined && node.getStage()._id === stage._id) {
stage._addId(node);
stage._addName(node);
go.tempNodes.splice(n, 1);
this.tempNodes.splice(n, 1);
n -= 1;
}
}