mirror of
https://github.com/storytold/deckcraft.git
synced 2026-10-31 14:07:06 -06:00
What was wrong: animation.add ignored a `path` parameter, so a customPath animation always got the default straight path of a quarter of the slide height, and no command could set or change the points of one. What changed: animation.add, animation.set and animation.options accept `path` for a motion path: either points [[x, y], ...] in slide points, as offsets from where the shape sits (converted to the stored slide-fraction path; `closed` returns to the first point), or the OOXML path string animation.get answers. At most 1000 points, finite numbers within 1e6 points, and strings of at most 16 KiB made of path commands and numbers are accepted; anything else is refused before the deck changes, as is `path` on an animation that is not a motion path. animation.add answers the stored path. How it was tested: three new tests in cmd/animation.rs: points become the expected path (add, set with `closed`, back to the default without `path`), a raw string is kept and animation.options replaces it, and malformed paths are refused with nothing added. The animation tests pass, and clippy is clean with -D warnings. Fixes #1576