Skip to content

Commit 7003520

Browse files
Merge pull request #29 from wikikhtn/fix_drawarea_not_update_on_init
Fix drawAreaRect not updated on first initialization
2 parents 04960bc + cb0c076 commit 7003520

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)