Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>

This commit is contained in:
Matt Bruce 2026-02-01 18:43:07 -06:00
parent 4979bd629a
commit 052e4715dc
3 changed files with 29 additions and 16 deletions

View File

@ -61,7 +61,11 @@ struct ContentView: View {
}
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color.BrandColors.primary.ignoresSafeArea())
// Background matches ring light color so rotation transitions are seamless
.background(
(settings.isRingLightEnabled ? settings.lightColor.opacity(settings.ringLightOpacity) : Color.black)
.ignoresSafeArea()
)
// Settings button overlay - only show when NOT in photo review mode
.overlay(alignment: .topTrailing) {
if !showPhotoReview {
@ -191,9 +195,9 @@ struct CameraContainerView: View, Equatable {
let cameraPosition: CameraPosition
let onImageCaptured: (UIImage) -> Void
// Only compare sessionKey for equality - ignore settings and callback changes
// Only compare sessionKey and cameraPosition for equality
static func == (lhs: CameraContainerView, rhs: CameraContainerView) -> Bool {
lhs.sessionKey == rhs.sessionKey
lhs.sessionKey == rhs.sessionKey && lhs.cameraPosition == rhs.cameraPosition
}
var body: some View {

View File

@ -341,21 +341,30 @@ struct CustomCameraScreen: MCameraScreen {
print("performActualCapture called - shouldUseCustomScreenFlash: \(shouldUseCustomScreenFlash)")
if shouldUseCustomScreenFlash {
// Save original brightness and boost to max
originalBrightness = UIScreen.main.brightness
UIScreen.main.brightness = 1.0
// Emulate iPhone Retina Flash behavior:
// 1. Pre-flash (briefly show flash to let camera adjust exposure)
// 2. Sustain (peak brightness for capture)
// 3. Capture (timed during sustain)
// Show flash overlay
isShowingScreenFlash = true
// Wait for camera to adjust to bright screen, then capture
Task { @MainActor in
try? await Task.sleep(for: .milliseconds(150))
print("Calling captureOutput() with custom flash")
// Save original brightness
originalBrightness = UIScreen.main.brightness
// 1. Pre-flash: Boost brightness and show overlay briefly
UIScreen.main.brightness = 1.0
isShowingScreenFlash = true
// Brief pre-flash duration to let auto-exposure settle
try? await Task.sleep(for: .milliseconds(200))
// 2. Sustain & 3. Capture
print("Calling captureOutput() during sustain phase")
captureOutput()
// Keep flash visible briefly after capture
try? await Task.sleep(for: .milliseconds(100))
// Keep flash visible briefly after capture to avoid abrupt cut-off
try? await Task.sleep(for: .milliseconds(150))
// Cleanup
isShowingScreenFlash = false
UIScreen.main.brightness = originalBrightness
}