rect method

Rect rect({
  1. required Rect startRect,
  2. required Rect currentRect,
})

Implementation

Rect rect({
  required Rect startRect,
  required Rect currentRect,
}) {
  final width = startRect.width * scale;
  final height = startRect.height * scale;
  if (currentRect.width == 0) return currentRect;
  final center = (currentRect.center - focalPoint) * width / currentRect.width + focalPoint + focalPointDelta;
  return Rect.fromCenter(
    center: center,
    width: width,
    height: height,
  );
}