function calculateDimensionRightBottomEdge(
  overflowAreaPositionFixer,
  {
    left,
    top,
    insideCanvasRealImageWidth,
    insideCanvasRealImageHeight,
    right,
    bottom,
    cropX,
    cropY,
    originalWidth,
    originalHeight,
  }
) {
  let [width, height] = [insideCanvasRealImageWidth, insideCanvasRealImageHeight];
  const { width: canvasWidth, height: canvasHeight } = cachedCanvasImageElement;

  if (right > canvasWidth && cropX > 0) {
    width = originalWidth - Math.abs(right - canvasWidth);
  }
  if (bottom > canvasHeight && cropY > 0) {
    height = originalHeight - Math.abs(bottom - canvasHeight);
  }

  const diff = {
    x: (insideCanvasRealImageWidth - width) / 2,
    y: (insideCanvasRealImageHeight - height) / 2,
  };

  forEach(['x', 'y'], (type) => {
    const cropDistance2 = diff[type];
    if (cropDistance2 > 0) {
      [left, top] = overflowAreaPositionFixer(type, cropDistance2, left, top);
    }
  });

  return [left, top, width, height];
}
Calculate fill image position and size for for right bottom edge
@param {Function} overflowAreaPositionFixer - position fixer
@param {Object} options - options for position dimension calculate
  @param {fabric.Object} shapeObj - shape object
  @param {number} left - original left position
  @param {number} top - original top position
  @param {number} width - image width
  @param {number} height - image height
  @param {number} right - image right
  @param {number} bottom - image bottom
  @param {number} cropX - image cropX
  @param {number} cropY - image cropY
  @param {boolean} originalWidth - image original width
  @param {boolean} originalHeight - image original height
@returns {Object}