function adjustDimensionOnScaling(shape) {
  const { type, scaleX, scaleY } = shape;
  const dimensionKeys = DIMENSION_KEYS[type];
  let width = shape[dimensionKeys.w] * scaleX;
  let height = shape[dimensionKeys.h] * scaleY;

  if (shape.isRegular) {
    const maxScale = Math.max(scaleX, scaleY);

    width = shape[dimensionKeys.w] * maxScale;
    height = shape[dimensionKeys.h] * maxScale;
  }

  const options = {
    hasControls: false,
    hasBorders: false,
    scaleX: 1,
    scaleY: 1,
  };

  options[dimensionKeys.w] = width;
  options[dimensionKeys.h] = height;

  shape.set(options);
}
Adjust the dimension of shape on firing scaling event
@param {fabric.Object} shape - Shape object
@ignore