Skip to content

Commit 1acc6b0

Browse files
committed
add forceSourceSize param for PaintModel.copyWith method.
1 parent 080de9c commit 1acc6b0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/src/api/models/paint.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ class PaintModel with EquatableMixin, SerializableMixin {
394394
double? sourceHeight,
395395
ImageRepeatEnum? imageRepeat,
396396
String? id,
397+
bool forceSourceSize = false,
397398
}) =>
398399
PaintModel(
399400
id: id ?? this.id,
@@ -413,8 +414,10 @@ class PaintModel with EquatableMixin, SerializableMixin {
413414
alignment: alignment ?? this.alignment,
414415
scaleX: scaleX ?? this.scaleX,
415416
scaleY: scaleY ?? this.scaleY,
416-
sourceWidth: sourceWidth ?? this.sourceWidth,
417-
sourceHeight: sourceHeight ?? this.sourceHeight,
417+
sourceWidth:
418+
forceSourceSize ? sourceWidth : sourceWidth ?? this.sourceWidth,
419+
sourceHeight:
420+
forceSourceSize ? sourceHeight : sourceHeight ?? this.sourceHeight,
418421
cropData: clearCropData ? null : cropData ?? this.cropData,
419422
croppedImageURL:
420423
clearCropData ? null : croppedImageURL ?? this.croppedImageURL,

0 commit comments

Comments
 (0)