From 9c5fc364693ee355fe76fb2bbaf24d824d68f890 Mon Sep 17 00:00:00 2001 From: moyuru Date: Sun, 16 Jul 2023 02:10:49 +0900 Subject: [PATCH] fix cropping --- cropify/src/main/java/io/moyuru/cropify/Cropify.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cropify/src/main/java/io/moyuru/cropify/Cropify.kt b/cropify/src/main/java/io/moyuru/cropify/Cropify.kt index 94bfd8c..8fcabbf 100644 --- a/cropify/src/main/java/io/moyuru/cropify/Cropify.kt +++ b/cropify/src/main/java/io/moyuru/cropify/Cropify.kt @@ -98,12 +98,11 @@ fun Cropify( LaunchedEffect(state.shouldCrop) { if (state.shouldCrop) { val loadedUri = state.loadedUri - if (loadedUri != null) { + val cropped = if (loadedUri != null) { cropSampledImage(context, bitmap, loadedUri, state.frameRect, state.imageRect, state.inSampleSize) } else { cropImage(bitmap, state.frameRect, state.imageRect) } - val cropped = cropImage(bitmap, state.frameRect, state.imageRect) state.shouldCrop = false onImageCropped(cropped) }