Summary
Add support for stroke-dashoffset (dash phase) across the engine, SVG import, serialization, and editor UI.
Currently StrokeDashArray is a plain Vec<f32> of alternating dash/gap lengths with no offset. SVG's stroke-dashoffset attribute is silently dropped during import.
Motivation
stroke-dashoffset is a basic SVG stroke property — dropping it causes visual fidelity loss on import.
- Dash offset is essential for animated dashed strokes (e.g. "marching ants" selection, loading spinners).
- Design tools (Figma, Illustrator) expose dash offset as an authorable property.
Scope
Core engine (crates/grida-canvas)
SVG import (crates/grida-canvas/src/svg)
SVG export
Editor UI (editor/)
References
Summary
Add support for
stroke-dashoffset(dash phase) across the engine, SVG import, serialization, and editor UI.Currently
StrokeDashArrayis a plainVec<f32>of alternating dash/gap lengths with no offset. SVG'sstroke-dashoffsetattribute is silently dropped during import.Motivation
stroke-dashoffsetis a basic SVG stroke property — dropping it causes visual fidelity loss on import.Scope
Core engine (
crates/grida-canvas)dash_offset: f32field to the stroke style schema (alongsidestroke_dash_array)PathEffect::dashcall (the second argument isphase)StrokeDashArrayor the stroke style to carry the offset.grida(JSON + FlatBuffers) roundtrip for the new fieldSVG import (
crates/grida-canvas/src/svg)stroke-dashoffsetfrom usvg (path.stroke().dashoffset()) duringfrom_usvgconversionSVGStrokeAttributesand propagate to the node schemaSVG export
stroke-dashoffsetwhen non-zeroEditor UI (
editor/)References
SkDashPathEffect::Make(intervals, count, phase)Stroke::dashoffset()returnsf32