Skip to content

Commit 7c83219

Browse files
Fixed issue with fitcropspace
1 parent bb22f4d commit 7c83219

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/src/calculators/calculate_crop_fit_params.dart

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import 'dart:math';
2-
31
import 'package:custom_image_crop/src/models/params_model.dart';
42
import 'package:custom_image_crop/src/widgets/custom_image_crop_widget.dart';
53

@@ -39,13 +37,11 @@ CropFitParams calculateCropFitParams({
3937
if (screenWidth <= screenHeight * aspectRatio) {
4038
cropSizeWidth = screenWidth * cropPercentage;
4139
cropSizeHeight = cropSizeWidth / aspectRatio;
42-
defaultScale =
43-
cropSizeWidth / max(imageWidth, imageHeight * aspectRatio);
40+
defaultScale = cropSizeHeight / imageHeight;
4441
} else {
4542
cropSizeHeight = screenHeight * cropPercentage;
4643
cropSizeWidth = cropSizeHeight * aspectRatio;
47-
defaultScale =
48-
cropSizeHeight / max(imageHeight, imageWidth / aspectRatio);
44+
defaultScale = cropSizeWidth / imageWidth;
4945
}
5046
break;
5147

0 commit comments

Comments
 (0)