-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
Extract a shared utility to compute bounds for node positions and use it in minimap and SVG export code.
Why
Both draw_minimap and export_to_svg iterate all positions to compute (min_x, max_x, min_y, max_y) with near-identical logic.
Affected files
- src/ui/drawing.rs
- src/ui/export.rs
Extraction plan
- Add utility like
positions_bounds(&HashMap<String, Pos2>) -> Option<(f32, f32, f32, f32)>. - Reuse utility in
draw_minimapworld-bounds calculation. - Reuse utility in
export_to_svgand keep padding behavior local to export. - Add tests for empty/non-empty bounds.
Risk
Low. Shared numeric helper; small risk of changing empty-state behavior if not preserved.
Acceptance criteria
- Single bounds utility used by both minimap and SVG export.
- Empty-position behavior unchanged.
- Tests pass.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels