Skip to content

Commit 7449f1f

Browse files
committed
Fix Curve velocity bug
1 parent cee39af commit 7449f1f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/OpenSwiftUICore/Animation/Animation/UnitCurve.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,8 @@ extension UnitCurve {
285285

286286
package func velocity(at time: Double) -> Double {
287287
let t = solveX(time, epsilon: pow(2, -20))
288-
let x = cx + (bx + bx) * t + (ax * 3 * t)
289-
let y = cy + (by + by) * t + (ay * 3 * t)
288+
let x = cx + ((bx + bx) + (ax * 3 * t)) * t
289+
let y = cy + ((by + by) + (ay * 3 * t)) * t
290290
guard x != y else {
291291
return 1.0
292292
}

0 commit comments

Comments
 (0)