getDimensions(element, svg = null) {
    let w = this.drawer.opts.width;
    let h = this.drawer.opts.height;

    if (this.drawer.opts.scale <= 0) {
      if (w === null) {
        w = element.width;
      }

      if (h === null) {
        h = element.height;
      }

      if (element.style.width !== "") {
        w = parseInt(element.style.width);
      }

      if (element.style.height !== "") {
        h = parseInt(element.style.height);
      }
    } else if (svg) {
      w = parseFloat(svg.style.width);
      h = parseFloat(svg.style.height);
    }

    return {
      w: w,
      h: h
    };
  }
@param {HTMLImageElement|HTMLCanvasElement|SVGElement} element 
@param {SVGElement} svg 
@returns {{w: Number, h: Number}} The width and height.