From 85cf19dac7c2752acb1c7c965ffd3ffb88cddfdd Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 8 Nov 2026 13:06:07 +0100 Subject: [PATCH] fix: hold white illumination until photo capture completes --- AGENTS.md | 1 + src/capture.rs | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 36d4d09..2286260 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -8,3 +8,4 @@ - Brand the header as `winf photobooth`, using the standard winf.at favicon, without a tagline or live-camera badge. - Size instruction panels to their content and use consistent padding at the screen edges. - Scale branding, icons, typography, and spacing with screen dimensions; cap the centered instruction panel width on large monitors. +- The monitor provides room lighting: keep the translucent white overlay on throughout the countdown and until photo capture returns; do not fade it out early. diff --git a/src/capture.rs b/src/capture.rs index 01d911f..a4e2314 100644 --- a/src/capture.rs +++ b/src/capture.rs @@ -45,8 +45,9 @@ impl Sequence { let elapsed = now.duration_since(start).as_secs_f32(); Presentation { countdown: (3 - elapsed as i32).clamp(1, 3), - // A brief translucent white flash when the palm circle fills. - flash_opacity: 0.75 * (1.0 - elapsed / 0.4).clamp(0.0, 1.0), + // The monitor lights the room: hold white illumination until + // the countdown completes and take_picture() returns. + flash_opacity: 0.75, awaiting_release: false, } } @@ -81,14 +82,14 @@ mod tests { sequence .presentation(start + Duration::from_millis(200)) .flash_opacity, - 0.375 + 0.75 ); for (ms, number) in [(999, 3), (1000, 2), (1999, 2), (2000, 1), (2999, 1)] { let now = start + Duration::from_millis(ms); // Lowering the hand must not cancel an already-started countdown. assert!(!sequence.tick(false, false, now)); assert_eq!(sequence.presentation(now).countdown, number); - assert_eq!(sequence.presentation(now).flash_opacity, 0.0); + assert_eq!(sequence.presentation(now).flash_opacity, 0.75); } assert!(sequence.tick(true, true, start + Duration::from_secs(3))); assert!( @@ -102,6 +103,12 @@ mod tests { .countdown, 0 ); + assert_eq!( + sequence + .presentation(start + Duration::from_secs(3)) + .flash_opacity, + 0.0 + ); assert!(!sequence.tick(true, true, start + Duration::from_secs(4))); assert!(!sequence.tracking()); assert!(!sequence.tick(false, false, start + Duration::from_secs(5)));