static svgToImg(svg, img, width, height) {
    let canvas = document.createElement('canvas');
    this.svgToCanvas(svg, canvas, width, height, result => {
      img.src = canvas.toDataURL("image/png");
    });
  }
Convert an SVG to a canvas. Warning: This happens async!

@param {SVGElement} svg 
@param {HTMLImageElement} canvas 
@param {Number} width 
@param {Number} height