feat(svg): progressive path draw-on animation#60
Merged
Conversation
draw_in/stroke_reveal now apply to the svg component: when draw_progress is animating (or draw: true), the usvg tree is walked and each path converted to Skia (move/line/quad/cubic/close with absolute transforms) and traced progressively with the dash technique shared with line/connector. Progress spreads sequentially across paths by measured length; draw_overlap interpolates to parallel. Fill-only paths trace their contour with draw_stroke_width. At progress 1.0 the render falls through to the unchanged resvg rasterization (fills restored); the static path stays byte-identical.
This was referenced Jul 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #48.
Goal: evolvePath-style draw-on for real SVGs — the svg component rasterized statically and
draw_inonly worked on shape/line/arrow/connector.tiny_skiawas already a dependency)draw_overlap: 0.0→1.0interpolates toward all-parallel); partial paths use the same dash technique as line/connectordraw_stroke_width, default 2.0) — the classic logo-reveal lookdraw_progress ≥ 1.0falls through to the unchanged resvg rasterization (fills restored); static rendering byte-identical; three additive schema fields (draw,draw_stroke_width,draw_overlap)Tests: 7 new pixel tests (zero at 0, first-path-only at 0.5, complete at 1.0, parallel with overlap, fill-only contour, static unchanged, draw without animation). 303 total, all green.
Verify:
cargo test --workspace→ 303 passed ✓ ·cargo fmt --check✓ · clippy 0 warnings ✓