Summary
Refactor edge curve control point math into a shared helper and reuse it in both runtime drawing and SVG export.
Why
src/ui/drawing.rs and src/ui/export.rs independently compute the same quadratic Bezier control point geometry for edges. This duplication risks drift and subtle visual mismatch.
Affected files
- src/ui/drawing.rs
- src/ui/export.rs
Extraction plan
- Add
edge_control_point(p0: Pos2, p2: Pos2, curve_cap: f32) -> Pos2 in src/ui/drawing.rs.
- Replace inline control-point math in drawing path with the helper.
- Import and reuse the helper in
src/ui/export.rs (with export-specific curve_cap).
- Add/adjust focused unit tests for helper behavior.
Risk
Low. Pure geometry extraction with no behavioral intent change.
Acceptance criteria
- Single helper computes edge control points for both drawing and export paths.
- Existing edge rendering behavior remains visually consistent.
- Tests pass.
Summary
Refactor edge curve control point math into a shared helper and reuse it in both runtime drawing and SVG export.
Why
src/ui/drawing.rsandsrc/ui/export.rsindependently compute the same quadratic Bezier control point geometry for edges. This duplication risks drift and subtle visual mismatch.Affected files
Extraction plan
edge_control_point(p0: Pos2, p2: Pos2, curve_cap: f32) -> Pos2insrc/ui/drawing.rs.src/ui/export.rs(with export-specificcurve_cap).Risk
Low. Pure geometry extraction with no behavioral intent change.
Acceptance criteria