function adjustDimensionOnMouseMove(pointer, shape) {
  const { type, strokeWidth, startPoint: origin } = shape;
  const divisor = DIVISOR[type];
  const dimensionKeys = DIMENSION_KEYS[type];
  const isTriangle = !!(shape.type === 'triangle');
  const options = {};
  let width = Math.abs(origin.x - pointer.x) / divisor;
  let height = Math.abs(origin.y - pointer.y) / divisor;

  if (width > strokeWidth) {
    width -= strokeWidth / divisor;
  }

  if (height > strokeWidth) {
    height -= strokeWidth / divisor;
  }

  if (shape.isRegular) {
    width = height = Math.max(width, height);

    if (isTriangle) {
      height = (Math.sqrt(3) / 2) * width;
    }
  }

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

  shape.set(options);
}
Adjust the dimension of shape on firing mouse move event
@param {{x: number, y: number}} pointer - Pointer value
@param {fabric.Object} shape - Shape object
@ignore