Skip to content

Commit 34116a1

Browse files
authored
Merge pull request #14 from MoyuruAizawa/fix-cropping
fix cropping
2 parents f822c91 + 9c5fc36 commit 34116a1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

cropify/src/main/java/io/moyuru/cropify/Cropify.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,11 @@ fun Cropify(
9898
LaunchedEffect(state.shouldCrop) {
9999
if (state.shouldCrop) {
100100
val loadedUri = state.loadedUri
101-
if (loadedUri != null) {
101+
val cropped = if (loadedUri != null) {
102102
cropSampledImage(context, bitmap, loadedUri, state.frameRect, state.imageRect, state.inSampleSize)
103103
} else {
104104
cropImage(bitmap, state.frameRect, state.imageRect)
105105
}
106-
val cropped = cropImage(bitmap, state.frameRect, state.imageRect)
107106
state.shouldCrop = false
108107
onImageCropped(cropped)
109108
}

0 commit comments

Comments
 (0)