Skip to content

Commit e5424e9

Browse files
authored
API: CropImageOptions#canChangeCropWindow option. (#636)
1 parent a25c2c8 commit e5424e9

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

cropper/src/main/kotlin/com/canhub/cropper/CropImageOptions.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ import kotlinx.parcelize.Parcelize
4040
@JvmField var multiTouchEnabled: Boolean = false,
4141
/** If the crop window can be moved by dragging the crop window in the center. */
4242
@JvmField var centerMoveEnabled: Boolean = true,
43+
/** If you are allowed to change the crop window by resizing it. */
44+
@JvmField var canChangeCropWindow: Boolean = true,
4345
@JvmField var maxZoom: Int = 4,
4446
/** In percentage. 0.1 means 10% on both sides. */
4547
@JvmField var initialCropWindowPaddingRatio: Float = 0.0f,

cropper/src/main/kotlin/com/canhub/cropper/CropOverlayView.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ internal class CropOverlayView @JvmOverloads constructor(
485485
cornerShape = options.cornerShape
486486
cropShape = options.cropShape
487487
mSnapRadius = options.snapRadius
488+
isEnabled = options.canChangeCropWindow
488489
guidelines = options.guidelines
489490
isFixAspectRatio = options.fixAspectRatio
490491
aspectRatioX = options.aspectRatioX

0 commit comments

Comments
 (0)