fix(live-room-like-heart): 하트 모양 수정

This commit is contained in:
Yu Sung
2025-11-05 22:00:54 +09:00
parent a4c5a790fe
commit 54d8845342
2 changed files with 18 additions and 16 deletions
@@ -18,7 +18,7 @@ struct WaterHeartView: View {
ZStack { ZStack {
// 하트 외곽선 // 하트 외곽선
HeartShape() HeartShape()
.stroke(lineWidth: size * 0.03) .stroke(lineWidth: size * 0.01)
.foregroundStyle(Color(hex: "ff959a")) .foregroundStyle(Color(hex: "ff959a"))
.opacity(show ? 1 : 0) .opacity(show ? 1 : 0)
@@ -42,7 +42,7 @@ struct WaterHeartView: View {
.animation(.easeInOut(duration: 0.2), value: show) .animation(.easeInOut(duration: 0.2), value: show)
} }
} }
.aspectRatio(4/3, contentMode: .fit) .aspectRatio(1, contentMode: .fit)
} }
} }
@@ -61,22 +61,24 @@ struct HeartShape: Shape {
} }
var p = Path() var p = Path()
// - notch: y ≈ -0.20
// - shoulder 넓힘: (±1.20, 0.12) → (±1.25, 0.12) // 위쪽 파임
// - lobe top 하강: (±0.80, -0.95) → (±0.80, -0.85) p.move(to: pt(0.0, -0.45))
p.move(to: pt(0, -0.20)) // top notch (shallow)
// right lobe → bottom tip // 오른쪽 반쪽: 둥근 윗볼 -> 어깨 -> 바닥 포인트
p.addCurve( p.addCurve(
to: pt(0, 1.0), to: pt(0.0, 0.65), // 바닥 포인트(최저점)
control1: pt(0.80, -0.85), // right lobe top (lowered) control1: pt(0.62, -1.02), // 오른쪽 윗볼의 정점 쪽(더 둥글게/높게)
control2: pt(1.25, 0.12) // right shoulder (wider) control2: pt(1.22, -0.04) // 오른쪽 어깨(조금 위로, 더 바깥쪽)
) )
// left lobe → back to notch
// 왼쪽 반쪽: 대칭
p.addCurve( p.addCurve(
to: pt(0, -0.20), to: pt(0.0, -0.45), // 시작점(위쪽 파임)으로 회귀
control1: pt(-1.25, 0.12), // left shoulder (wider) control1: pt(-1.22, -0.04), // 왼쪽 어깨
control2: pt(-0.80, -0.85) // left lobe top (lowered) control2: pt(-0.62, -1.02) // 왼쪽 윗볼
) )
p.closeSubpath() p.closeSubpath()
return p return p
} }
@@ -771,7 +771,7 @@ struct LiveRoomViewV2: View {
WaterHeartView(progress: viewModel.remoteWaterProgress, WaterHeartView(progress: viewModel.remoteWaterProgress,
show: viewModel.isShowRemoteBigHeart, show: viewModel.isShowRemoteBigHeart,
phase: viewModel.remoteWavePhase) phase: viewModel.remoteWavePhase)
.frame(width: 280, height: 210) .frame(width: 280, height: 280)
.allowsHitTesting(false) .allowsHitTesting(false)
// 롱프레스 로컬 연출 중에는 원격 하트를 숨겨 중복 방지 // 롱프레스 로컬 연출 중에는 원격 하트를 숨겨 중복 방지
.opacity((viewModel.isShowRemoteBigHeart && !showWaterHeart) ? 1 : 0) .opacity((viewModel.isShowRemoteBigHeart && !showWaterHeart) ? 1 : 0)