mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-14 18:01:20 +08:00
acf2491e0f
The canvas overlay drew straight chords between a tween's nodes. For x/y keyframes that is the real motion, but a motionPath curves between its anchors, so on an arc the guide cut across corners the element swung wide of: the line an author dragged did not match the line the element took. Sample GSAP's own resolved curve (MotionPathPlugin.arrayToRawPath) for the drawn path, and hit-test the add-a-node ghost against that same sampled curve so it lands where the author can see it. Cubic anchors keep the chord guide, because their control points are not reproducible from a single curviness value. Dot the path at equal steps of time rather than dashing it at equal steps of distance, so the spacing reads as velocity the way After Effects does. Timing honours each keyframe's own ease, since a keyframes array eases every step separately.