PR5 of ck-diagram: multi-select, group, z-order, snap-to-grid #55
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/055-pr5-of-ck-diagram-multi-select-group-z-order-s"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PR5 of ck-diagram: multi-select, group, z-order, snap-to-grid
Along the way:
Touches 9 files:
ck-diagram/README.md,ck-diagram/src/canvas.rs,ck-diagram/src/history.rs,ck-diagram/src/lib.rs,ck-diagram/src/minimap.rs,ck-diagram/tests/canvas.rsand 3 more.I do not want to merge while the error path in
ck-diagram/tests/minimap.rsis silent. The rest is fine.@ -0,0 +80,4 @@vec![fresh_input(), down, up]}fn drag(start: egui::Pos2, end: egui::Pos2) -> Vec<egui::RawInput> {dragreads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?Split. The decision in
dragis a pure function now, with its own tests inck-diagram/tests/minimap.rs.Done, and I added the test for
ck-diagram/tests/minimap.rsthat would have caught it.Good. The second pass on
ck-diagram/tests/minimap.rsis what I hoped for.Read it too. No objection to
ck-diagram/tests/minimap.rs.Turns the canvas multi-shape. Selection is `&[ShapeId]`: shift-click adds, ctrl-click toggles, left-drag from empty canvas opens a rubber-band rectangle that selects every shape it intersects. Drag any selected shape to move the whole selection, quantized to the 20- unit grid unless Alt is held. `]` / `[` / `}` / `{` and the canvas right-click menu reorder; `Ctrl+G` / `Ctrl+Shift+G` group / ungroup; clicking any group member expands the selection to the whole group. `Ctrl+A` selects everything; `Delete` records a single DeleteMany entry across the selection. History gains MoveMany, DeleteMany, ZOrder, CreateGroup, and UngroupSelection variants; empty multi-shape entries are dropped at record time. Coverage stays at 100% lines / regions / functions across the crate.