Skip to content

Commit

Permalink
clamp
Browse files Browse the repository at this point in the history
  • Loading branch information
bvandercar-vt committed May 8, 2024
1 parent d829e31 commit df5c878
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/math.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,7 @@ export const bezierCurve = (
const max = 200
const vec = direction(start, finish)
const length = magnitude(vec)
const spread = clamp(length, min, max)
const anchors = generateBezierAnchors(
start,
finish,
overrideSpread ?? spread
)
const spread = overrideSpread ?? clamp(length, min, max)
const anchors = generateBezierAnchors(start, finish, spread)
return new Bezier(start, ...anchors, finish)
}

0 comments on commit df5c878

Please sign in to comment.