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:
parent
9250a44a65
commit
e4cb7fc9da
@ -16,7 +16,7 @@ struct ContentView: View {
|
|||||||
|
|
||||||
/// Ring size clamped to reasonable max
|
/// Ring size clamped to reasonable max
|
||||||
private var effectiveRingSize: CGFloat {
|
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)
|
return min(settings.ringSize, maxRing)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,8 +26,9 @@ struct ContentView: View {
|
|||||||
settings.lightColor
|
settings.lightColor
|
||||||
.ignoresSafeArea()
|
.ignoresSafeArea()
|
||||||
|
|
||||||
// MijickCamera with default UI, padded for ring effect
|
// MijickCamera with default UI
|
||||||
MCamera()
|
MCamera()
|
||||||
|
.setCameraPosition(.front) // Default to front camera for selfies
|
||||||
.onImageCaptured { image, _ in
|
.onImageCaptured { image, _ in
|
||||||
capturedImage = image
|
capturedImage = image
|
||||||
showPostCapture = true
|
showPostCapture = true
|
||||||
@ -37,10 +38,11 @@ struct ContentView: View {
|
|||||||
showPostCapture = true
|
showPostCapture = true
|
||||||
}
|
}
|
||||||
.startSession()
|
.startSession()
|
||||||
.clipShape(RoundedRectangle(cornerRadius: Design.CornerRadius.large))
|
.padding(.horizontal, effectiveRingSize)
|
||||||
.padding(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 {
|
VStack {
|
||||||
HStack {
|
HStack {
|
||||||
Spacer()
|
Spacer()
|
||||||
@ -53,11 +55,12 @@ struct ContentView: View {
|
|||||||
.foregroundStyle(.white)
|
.foregroundStyle(.white)
|
||||||
.padding(Design.Spacing.medium)
|
.padding(Design.Spacing.medium)
|
||||||
.background(.ultraThinMaterial, in: Circle())
|
.background(.ultraThinMaterial, in: Circle())
|
||||||
|
.shadow(radius: Design.Shadow.radiusSmall)
|
||||||
}
|
}
|
||||||
.accessibilityLabel("Settings")
|
.accessibilityLabel("Settings")
|
||||||
}
|
}
|
||||||
.padding(.horizontal, effectiveRingSize + Design.Spacing.small)
|
.padding(.horizontal, effectiveRingSize + Design.Spacing.medium)
|
||||||
.padding(.top, Design.Spacing.small)
|
.padding(.top, effectiveRingSize + Design.Spacing.medium)
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,10 +61,6 @@
|
|||||||
"comment" : "The text for a button that dismisses the current view.",
|
"comment" : "The text for a button that dismisses the current view.",
|
||||||
"isCommentAutoGenerated" : true
|
"isCommentAutoGenerated" : true
|
||||||
},
|
},
|
||||||
"Capture" : {
|
|
||||||
"comment" : "A button that, when tapped, takes a photo.<turn_end>```",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
|
||||||
"Captured photo" : {
|
"Captured photo" : {
|
||||||
"comment" : "A label describing a captured photo.",
|
"comment" : "A label describing a captured photo.",
|
||||||
"isCommentAutoGenerated" : true
|
"isCommentAutoGenerated" : true
|
||||||
@ -265,10 +261,6 @@
|
|||||||
},
|
},
|
||||||
"Syncing..." : {
|
"Syncing..." : {
|
||||||
|
|
||||||
},
|
|
||||||
"Takes a photo" : {
|
|
||||||
"comment" : "An accessibility hint for the capture button.",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
},
|
||||||
"Third-party libraries used in this app" : {
|
"Third-party libraries used in this app" : {
|
||||||
"comment" : "A description of the third-party libraries used in this app.",
|
"comment" : "A description of the third-party libraries used in this app.",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user