Skip to content

Commit cb0c076

Browse files
committed
fix drawAreaRect not updated on first initialization
1 parent 04960bc commit cb0c076

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cropper/src/main/java/com/smarttoolfactory/cropper/state/CropStateImpl.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,6 @@ abstract class CropState internal constructor(
314314
val newPanX = pan.x + panXChange
315315
val newPanY = pan.y + panYChange
316316

317-
// Update draw area based on new pan and zoom values
318-
drawAreaRect = newDrawAreaRect
319-
320317
if (animate) {
321318
resetWithAnimation(
322319
pan = Offset(newPanX, newPanY),
@@ -330,6 +327,8 @@ abstract class CropState internal constructor(
330327
}
331328

332329
resetTracking()
330+
331+
drawAreaRect = updateImageDrawRectFromTransformation()
333332
}
334333

335334
/**

0 commit comments

Comments
 (0)