calculatedAfterAdjustSize function

Size calculatedAfterAdjustSize(
  1. Size image,
  2. Size minimumSizeOfImage,
  3. Size currentSize
)

Implementation

Size calculatedAfterAdjustSize(
  Size image,
  Size minimumSizeOfImage,
  Size currentSize,
) {
  double width = currentSize.width;
  double height = currentSize.height;
  if (width < minimumSizeOfImage.width) {
    width = minimumSizeOfImage.width;
  }
  double calculateHeight = calculateNewHeight(
      image.width.toDouble(), image.height.toDouble(), width);
  if (calculateHeight < minimumSizeOfImage.height) {
    calculateHeight = minimumSizeOfImage.height;
    double calculateWidth = calculateNewWidth(
        image.width.toDouble(), image.height.toDouble(), calculateHeight);
    return Size(calculateWidth, calculateHeight);
  }
  return Size(width, calculateHeight);
}