CameraScreen: avoid ghost quads when live analysis starts

This commit is contained in:
Pierre-Yves Nicolas
2026-02-03 07:40:40 +01:00
parent 9cdff7e74b
commit b73dc20bd5
2 changed files with 10 additions and 0 deletions

View File

@@ -152,6 +152,10 @@ fun CameraScreen(
}
}
LaunchedEffect(Unit) {
cameraViewModel.resetLiveAnalysis()
}
val listState = rememberLazyListState()
LaunchedEffect(document.pageCount()) {
if (!document.isEmpty()) {

View File

@@ -89,8 +89,14 @@ class CameraViewModel(appContainer: AppContainer): ViewModel() {
}
}
fun resetLiveAnalysis() {
quadStabilizer = QuadStabilizer()
_liveAnalysisState.value = LiveAnalysisState()
}
fun onCapturePressed(frozenImage: Bitmap) {
_captureState.value = CaptureState.Capturing(frozenImage)
resetLiveAnalysis()
}
private fun onCaptureProcessed(captured: CapturedPage?) {