diff --git a/src/static_canvas.class.js b/src/static_canvas.class.js index eb159d4c..94f05462 100644 --- a/src/static_canvas.class.js +++ b/src/static_canvas.class.js @@ -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'; },