Merge pull request #1087 from Kienz/patch-1

Fix fabric.Canvas initialization for width/height attributes. Closes #1086
This commit is contained in:
Juriy Zaytsev 2014-01-12 06:38:07 -08:00
commit 2b74c2abc5

View file

@ -390,11 +390,14 @@
this[prop] = options[prop];
}
this.width = parseInt(this.lowerCanvasEl.width, 10) || 0;
this.height = parseInt(this.lowerCanvasEl.height, 10) || 0;
this.width = this.width || parseInt(this.lowerCanvasEl.width, 10) || 0;
this.height = this.height || parseInt(this.lowerCanvasEl.height, 10) || 0;
if (!this.lowerCanvasEl.style) return;
this.lowerCanvasEl.width = this.width;
this.lowerCanvasEl.height = this.height;
this.lowerCanvasEl.style.width = this.width + 'px';
this.lowerCanvasEl.style.height = this.height + 'px';
},