File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change 1
- import 'dart:math' ;
2
-
3
1
import 'package:custom_image_crop/src/models/params_model.dart' ;
4
2
import 'package:custom_image_crop/src/widgets/custom_image_crop_widget.dart' ;
5
3
@@ -39,13 +37,11 @@ CropFitParams calculateCropFitParams({
39
37
if (screenWidth <= screenHeight * aspectRatio) {
40
38
cropSizeWidth = screenWidth * cropPercentage;
41
39
cropSizeHeight = cropSizeWidth / aspectRatio;
42
- defaultScale =
43
- cropSizeWidth / max (imageWidth, imageHeight * aspectRatio);
40
+ defaultScale = cropSizeHeight / imageHeight;
44
41
} else {
45
42
cropSizeHeight = screenHeight * cropPercentage;
46
43
cropSizeWidth = cropSizeHeight * aspectRatio;
47
- defaultScale =
48
- cropSizeHeight / max (imageHeight, imageWidth / aspectRatio);
44
+ defaultScale = cropSizeWidth / imageWidth;
49
45
}
50
46
break ;
51
47
You can’t perform that action at this time.
0 commit comments