updateSize(width, height) {
    this.devicePixelRatio = window.devicePixelRatio || 1;
    this.backingStoreRatio = this.ctx.webkitBackingStorePixelRatio || this.ctx.mozBackingStorePixelRatio || this.ctx.msBackingStorePixelRatio || this.ctx.oBackingStorePixelRatio || this.ctx.backingStorePixelRatio || 1;
    this.ratio = this.devicePixelRatio / this.backingStoreRatio;

    if (this.ratio !== 1) {
      this.canvas.width = width * this.ratio;
      this.canvas.height = height * this.ratio;
      this.canvas.style.width = width + 'px';
      this.canvas.style.height = height + 'px';
      this.ctx.setTransform(this.ratio, 0, 0, this.ratio, 0, 0);
    } else {
      this.canvas.width = width * this.ratio;
      this.canvas.height = height * this.ratio;
    }
  }
Update the width and height of the canvas

@param {Number} width 
@param {Number} height