From 908fa24b8e9b217ed6bbd8d75cec5ac04323f222 Mon Sep 17 00:00:00 2001 From: Eric Rowell Date: Sat, 10 Nov 2012 17:05:35 -0800 Subject: [PATCH] fix 149 cleaned up Kinetic.Canvas usage --- src/Stage.js | 5 +---- src/util/Canvas.js | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Stage.js b/src/Stage.js index 6a06bdbb..417db814 100644 --- a/src/Stage.js +++ b/src/Stage.js @@ -561,10 +561,7 @@ Kinetic.Stage.prototype = { this.content.className = 'kineticjs-content'; this.attrs.container.appendChild(this.content); - this.bufferCanvas = new Kinetic.Canvas({ - width: this.attrs.width, - height: this.attrs.height - }); + this.bufferCanvas = new Kinetic.Canvas(); this._resizeDOM(); }, diff --git a/src/util/Canvas.js b/src/util/Canvas.js index 5597e9b3..c1012db8 100644 --- a/src/util/Canvas.js +++ b/src/util/Canvas.js @@ -9,8 +9,8 @@ Kinetic.Canvas = function(width, height) { this.context = this.element.getContext('2d'); // set dimensions - this.element.width = width; - this.element.height = height; + this.element.width = width || 0; + this.element.height = height || 0; }; Kinetic.Canvas.prototype = {