fix: PhysicsModifier body function + Angle type
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -211,14 +211,14 @@ struct PhysicsModifier: ViewModifier {
|
||||
private let gravity: CGFloat = 0.6
|
||||
private let duration: Double = 1.6
|
||||
|
||||
var body: some View {
|
||||
func body(content: Content) -> some View {
|
||||
let x = startX + vx * time
|
||||
let y = startY + vy * time + 0.5 * gravity * time * time
|
||||
|
||||
content
|
||||
.offset(x: x, y: y)
|
||||
.opacity(opacity)
|
||||
.rotationEffect(.degrees(spin * Double(time / 30)))
|
||||
.rotationEffect(Angle.degrees(spin * Double(time / 30)))
|
||||
.onAppear {
|
||||
withAnimation(.easeOut(duration: duration).delay(delay)) {
|
||||
time = 30
|
||||
|
||||
Reference in New Issue
Block a user