mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-08 16:30:59 +00:00
Merge pull request #1087 from Kienz/patch-1
Fix fabric.Canvas initialization for width/height attributes. Closes #1086
This commit is contained in:
commit
2b74c2abc5
1 changed files with 5 additions and 2 deletions
|
|
@ -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';
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue