get viewBox()

in packages/svg-mixer/lib/image.js [18:30]


  get viewBox() {
    const { width, height } = this;
    const { viewBox } = this._tree.root.attrs || {};
    let result;

    if (viewBox) {
      result = viewBox.split(' ').map(parseFloat);
    } else if (width && height) {
      result = [0, 0, width, height];
    }

    return result;
  }