function parseStringOrigin(origin, bbox) {
    var result;
    var x = bbox.x;
    var width = bbox.width;
    if (/[a-z]/i.test(origin) && !/px/.test(origin)) {
      result = origin.replace(/top|left/, 0)
        .replace(/right|bottom/, 100)
        .replace(/center|middle/, 50);
    } else {
      result = /%/.test(origin) ? (x + (parseFloat(origin) * width) / 100) : parseFloat(origin);
    }
    return result;
  }
Returns a correct transform origin consistent with the shape bounding box.
@param {string} origin transform origin string
@param {SVGPathCommander.pathBBox} bbox path bounding box
@returns {number}