));
    var height = parseInt(this.canvas.getAttribute('height'));

    if (!this.originalWidth || (Math.floor(this.originalWidth * dpr) !== width)) {
      this.canvas.setAttribute('width', (Math.floor(width * dpr)).toString());
      this.canvas.style.width = width + 'px';
      this.canvas.getContext('2d').scale(dpr, dpr);
    }

    if (!this.originalHeight || (Math.floor(this.originalHeight * dpr) !== height)) {
      this.originalHeight = height;
      this.canvas.setAttribute('height', (Math.floor(he