Skip to content

Commit 085a395

Browse files
authored
Fix avatar aspect ratio (#25)
1 parent eb626b2 commit 085a395

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

VoiceAgent/Interactions/TextInteractionView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ struct TextInteractionView: View {
3737
HStack {
3838
Spacer()
3939
AgentParticipantView()
40-
.frame(maxWidth: 25 * .grid)
40+
.frame(maxWidth: viewModel.avatarCameraTrack != nil ? 50 * .grid : 25 * .grid)
4141
ScreenShareView()
4242
LocalParticipantView()
4343
Spacer()
4444
}
45-
.frame(height: viewModel.isCameraEnabled || viewModel.isScreenShareEnabled ? 50 * .grid : 25 * .grid)
45+
.frame(height: viewModel.isCameraEnabled || viewModel.isScreenShareEnabled || viewModel.avatarCameraTrack != nil ? 50 * .grid : 25 * .grid)
4646
.safeAreaPadding()
4747
}
4848
}

VoiceAgent/Participant/AgentParticipantView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ struct AgentParticipantView: View {
1515
if let avatarCameraTrack = viewModel.avatarCameraTrack {
1616
SwiftUIVideoView(avatarCameraTrack)
1717
.clipShape(RoundedRectangle(cornerRadius: .cornerRadiusPerPlatform))
18+
.aspectRatio(avatarCameraTrack.aspectRatio, contentMode: .fit)
1819
.shadow(radius: 20, y: 10)
1920
.mask(
2021
GeometryReader { proxy in

VoiceAgent/Start/StartView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ struct StartView: View {
4949
}
5050
.font(.system(size: 12))
5151
.multilineTextAlignment(.center)
52-
.padding(.horizontal, horizontalSizeClass == .regular ? 32 * .grid : 16 * .grid)
52+
.safeAreaPadding(.horizontal, horizontalSizeClass == .regular ? 32 * .grid : 16 * .grid)
53+
.safeAreaPadding(.vertical)
5354
}
5455

5556
@ViewBuilder

0 commit comments

Comments
 (0)