Skip to content

Commit

Permalink
Fixed issue with fitcropspace
Browse files Browse the repository at this point in the history
  • Loading branch information
ikbendewilliam committed Sep 11, 2023
1 parent bb22f4d commit 7c83219
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/src/calculators/calculate_crop_fit_params.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:math';

import 'package:custom_image_crop/src/models/params_model.dart';
import 'package:custom_image_crop/src/widgets/custom_image_crop_widget.dart';

Expand Down Expand Up @@ -39,13 +37,11 @@ CropFitParams calculateCropFitParams({
if (screenWidth <= screenHeight * aspectRatio) {
cropSizeWidth = screenWidth * cropPercentage;
cropSizeHeight = cropSizeWidth / aspectRatio;
defaultScale =
cropSizeWidth / max(imageWidth, imageHeight * aspectRatio);
defaultScale = cropSizeHeight / imageHeight;
} else {
cropSizeHeight = screenHeight * cropPercentage;
cropSizeWidth = cropSizeHeight * aspectRatio;
defaultScale =
cropSizeHeight / max(imageHeight, imageWidth / aspectRatio);
defaultScale = cropSizeWidth / imageWidth;
}
break;

Expand Down

0 comments on commit 7c83219

Please sign in to comment.