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 {
// 하트 외곽선
HeartShape()
.stroke(lineWidth: size * 0.03)
.stroke(lineWidth: size * 0.01)
.foregroundStyle(Color(hex: "ff959a"))
.opacity(show ? 1 : 0)
@@ -42,7 +42,7 @@ struct WaterHeartView: View {
.animation(.easeInOut(duration: 0.2), value: show)
}
}
.aspectRatio(4/3, contentMode: .fit)
.aspectRatio(1, contentMode: .fit)
}
}
@@ -59,24 +59,26 @@ struct HeartShape: Shape {
func pt(_ nx: CGFloat, _ ny: CGFloat) -> CGPoint {
CGPoint(x: cx + nx * r, y: cy + ny * r)
}
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.20)) // top notch (shallow)
// right lobe → bottom tip
// 위쪽 파임
p.move(to: pt(0.0, -0.45))
// 오른쪽 반쪽: 둥근 윗볼 -> 어깨 -> 바닥 포인트
p.addCurve(
to: pt(0, 1.0),
control1: pt(0.80, -0.85), // right lobe top (lowered)
control2: pt(1.25, 0.12) // right shoulder (wider)
to: pt(0.0, 0.65), // 바닥 포인트(최저점)
control1: pt(0.62, -1.02), // 오른쪽 윗볼의 정점 쪽(더 둥글게/높게)
control2: pt(1.22, -0.04) // 오른쪽 어깨(조금 위로, 더 바깥쪽)
)
// left lobe → back to notch
// 왼쪽 반쪽: 대칭
p.addCurve(
to: pt(0, -0.20),
control1: pt(-1.25, 0.12), // left shoulder (wider)
control2: pt(-0.80, -0.85) // left lobe top (lowered)
to: pt(0.0, -0.45), // 시작점(위쪽 파임)으로 회귀
control1: pt(-1.22, -0.04), // 왼쪽 어깨
control2: pt(-0.62, -1.02) // 왼쪽 윗볼
)
p.closeSubpath()
return p
}
@@ -771,7 +771,7 @@ struct LiveRoomViewV2: View {
WaterHeartView(progress: viewModel.remoteWaterProgress,
show: viewModel.isShowRemoteBigHeart,
phase: viewModel.remoteWavePhase)
.frame(width: 280, height: 210)
.frame(width: 280, height: 280)
.allowsHitTesting(false)
// 롱프레스 로컬 연출 중에는 원격 하트를 숨겨 중복 방지
.opacity((viewModel.isShowRemoteBigHeart && !showWaterHeart) ? 1 : 0)