function getRotatedDimension(shapeObj) {
  const [{ x: ax, y: ay }, { x: bx, y: by }, { x: cx, y: cy }, { x: dx, y: dy }] =
    getShapeEdgePoint(shapeObj);

  const left = Math.min(ax, bx, cx, dx);
  const top = Math.min(ay, by, cy, dy);
  const right = Math.max(ax, bx, cx, dx);
  const bottom = Math.max(ay, by, cy, dy);

  return {
    left,
    top,
    right,
    bottom,
    width: right - left,
    height: bottom - top,
  };
}
Rotated shape dimension
@param {fabric.Object} shapeObj - Shape object
@returns {Object} Rotated shape dimension