getStage() result is now cached. refactored caching system even further.

This commit is contained in:
Eric Rowell
2013-08-11 20:34:54 -07:00
parent 8654391de4
commit d49ae15207
8 changed files with 93 additions and 90 deletions

View File

@@ -116,10 +116,18 @@
* @method
* @memberof Kinetic.Canvas.prototype
*/
clear: function() {
var context = this.getContext();
var el = this.getElement();
context.clearRect(0, 0, this.getWidth(), this.getHeight());
clear: function(clip) {
var context = this.getContext(),
pos, size;
if (clip) {
pos = Kinetic.Util._getXY(clip);
size = Kinetic.Util._getSize(clip);
context.clearRect(pos.x || 0, pos.y || 0, size.width, size.height);
}
else {
context.clearRect(0, 0, this.getWidth(), this.getHeight());
}
},
/**
* to data url