diff --git a/src/util/CanvasProvider.js b/src/util/CanvasProvider.js index e2f139d1..abcfba10 100644 --- a/src/util/CanvasProvider.js +++ b/src/util/CanvasProvider.js @@ -1,15 +1,18 @@ CanvasProvider = { canvases: [], - getCanvas: function(width, height) { + getCanvas: function() { + var size = Size.read(arguments); var canvas = this.canvases.length ? this.canvases.pop() : document.createElement('canvas'); - canvas.width = width; - canvas.height = height; + canvas.width = size.width; + canvas.height = size.height; return canvas; }, returnCanvas: function(canvas) { + // reset canvas: + canvas.width = canvas.width; this.canvases.push(canvas); } };