Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/src/editor/edit_action_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class EditActionDetails {
Rect? get layoutRect => _layoutRect;
Rect? _screenDestinationRect;
Rect? _rawDestinationRect;
Rect? initialCropRect;

double totalScale = 1.0;
double preTotalScale = 1.0;
Expand Down Expand Up @@ -721,6 +722,7 @@ class EditActionDetails {
double? cropAspectRatio,
double? rotateRadians,
double? rotationYRadians,
Rect? initialCropRect,
}) {
return EditActionDetails()
.._layoutRect = layoutRect ?? _layoutRect
Expand All @@ -736,6 +738,7 @@ class EditActionDetails {
..cropAspectRatio = cropAspectRatio ?? _cropAspectRatio
..rotateRadians = rotateRadians ?? this.rotateRadians
..rotationYRadians = rotationYRadians ?? this.rotationYRadians
..initialCropRect = initialCropRect ?? this.initialCropRect
..config = config;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/editor/editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ class ExtendedImageEditorState extends State<ExtendedImageEditor>
alignment is! Alignment ? Directionality.of(context) : null;
final Alignment resolvedAlignment = alignment.resolve(textDirection);
final Rect destinationRect = getDestinationRect(
rect: layoutRect,
rect: _editActionDetails?.initialCropRect ?? layoutRect,
inputSize: Size(
widget.extendedImageState.extendedImageInfo!.image.width.toDouble(),
widget.extendedImageState.extendedImageInfo!.image.height.toDouble(),
Expand Down