diff --git a/src/document/Document.js b/src/document/Document.js index 620a8b1c..bf8ea734 100644 --- a/src/document/Document.js +++ b/src/document/Document.js @@ -61,11 +61,12 @@ var Document = this.Document = Base.extend({ // Initial tests conclude that clearing the canvas using clearRect // is always faster than setting canvas.width = canvas.width // http://jsperf.com/clearrect-vs-setting-width/7 - this.context.clearRect(0, 0, this.size.width + 1, this.size.height + 1); + this.context.clearRect(0, 0, + this.size.width + 1, this.size.height + 1); this.context.save(); - + var param = { offset: new Point(0, 0) }; for (var i = 0, l = this.layers.length; i < l; i++) { - Item.draw(this.layers[i], this.context, { offset: new Point(0, 0)}); + Item.draw(this.layers[i], this.context, param); } this.context.restore(); }