resize(width, height) {
    this.element.width = width;
    this.element.height = height;
  }
Resizes the canvas element.
@param {number} width - The new width of the canvas.
@param {number} height - The new height of the canvas.