fixed drawing bug related to new throttle feature

This commit is contained in:
Eric Rowell
2012-04-28 13:46:54 -07:00
parent 6bed850042
commit 9cc380608e
5 changed files with 166 additions and 39 deletions

View File

@@ -43,6 +43,17 @@ Kinetic.Layer.prototype = {
this._draw();
this.lastDrawTime = time;
}
/*
* if we cannot draw the layer due to throttling,
* try to redraw the layer in the near future
*/
else if(this.drawTimeout === undefined) {
var that = this;
this.drawTimeout = setTimeout(function() {
that.draw();
clearTimeout(that.drawTimeout);
}, 5);
}
},
/**
* set throttle