We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb22f4d commit 7c83219Copy full SHA for 7c83219
lib/src/calculators/calculate_crop_fit_params.dart
@@ -1,5 +1,3 @@
1
-import 'dart:math';
2
-
3
import 'package:custom_image_crop/src/models/params_model.dart';
4
import 'package:custom_image_crop/src/widgets/custom_image_crop_widget.dart';
5
@@ -39,13 +37,11 @@ CropFitParams calculateCropFitParams({
39
37
if (screenWidth <= screenHeight * aspectRatio) {
40
38
cropSizeWidth = screenWidth * cropPercentage;
41
cropSizeHeight = cropSizeWidth / aspectRatio;
42
- defaultScale =
43
- cropSizeWidth / max(imageWidth, imageHeight * aspectRatio);
+ defaultScale = cropSizeHeight / imageHeight;
44
} else {
45
cropSizeHeight = screenHeight * cropPercentage;
46
cropSizeWidth = cropSizeHeight * aspectRatio;
47
48
- cropSizeHeight / max(imageHeight, imageWidth / aspectRatio);
+ defaultScale = cropSizeWidth / imageWidth;
49
}
50
break;
51
0 commit comments