Fix: Default to front camera and remove clipShape

- Set .setCameraPosition(.front) for selfie mode
- Remove clipShape so MijickCamera's controls aren't clipped
- Reduced max ring size to 20% to leave room for controls
- Fixed typo in capturedImage variable name
This commit is contained in:
Matt Bruce 2026-01-02 16:54:59 -06:00
parent 9250a44a65
commit e4cb7fc9da
2 changed files with 10 additions and 15 deletions

View File

@ -16,7 +16,7 @@ struct ContentView: View {
/// Ring size clamped to reasonable max
private var effectiveRingSize: CGFloat {
let maxRing = min(UIScreen.main.bounds.width, UIScreen.main.bounds.height) * 0.25
let maxRing = min(UIScreen.main.bounds.width, UIScreen.main.bounds.height) * 0.2
return min(settings.ringSize, maxRing)
}
@ -26,8 +26,9 @@ struct ContentView: View {
settings.lightColor
.ignoresSafeArea()
// MijickCamera with default UI, padded for ring effect
// MijickCamera with default UI
MCamera()
.setCameraPosition(.front) // Default to front camera for selfies
.onImageCaptured { image, _ in
capturedImage = image
showPostCapture = true
@ -37,10 +38,11 @@ struct ContentView: View {
showPostCapture = true
}
.startSession()
.clipShape(RoundedRectangle(cornerRadius: Design.CornerRadius.large))
.padding(effectiveRingSize)
.padding(.horizontal, effectiveRingSize)
.padding(.top, effectiveRingSize)
.padding(.bottom, effectiveRingSize)
// Settings button overlay (top right, safe area aware)
// Settings button overlay (top right corner of camera area)
VStack {
HStack {
Spacer()
@ -53,11 +55,12 @@ struct ContentView: View {
.foregroundStyle(.white)
.padding(Design.Spacing.medium)
.background(.ultraThinMaterial, in: Circle())
.shadow(radius: Design.Shadow.radiusSmall)
}
.accessibilityLabel("Settings")
}
.padding(.horizontal, effectiveRingSize + Design.Spacing.small)
.padding(.top, Design.Spacing.small)
.padding(.horizontal, effectiveRingSize + Design.Spacing.medium)
.padding(.top, effectiveRingSize + Design.Spacing.medium)
Spacer()
}

View File

@ -61,10 +61,6 @@
"comment" : "The text for a button that dismisses the current view.",
"isCommentAutoGenerated" : true
},
"Capture" : {
"comment" : "A button that, when tapped, takes a photo.<turn_end>```",
"isCommentAutoGenerated" : true
},
"Captured photo" : {
"comment" : "A label describing a captured photo.",
"isCommentAutoGenerated" : true
@ -265,10 +261,6 @@
},
"Syncing..." : {
},
"Takes a photo" : {
"comment" : "An accessibility hint for the capture button.",
"isCommentAutoGenerated" : true
},
"Third-party libraries used in this app" : {
"comment" : "A description of the third-party libraries used in this app.",