Skip to content

feat(ui-egui): Draw > Collect All gathers what drifted apart (#23) - #237

Merged
DWAA1660 merged 3 commits into
AlienTechSoftware:mainfrom
DWAA1660:feat/collect-all/23
Nov 14, 2026
Merged

DWAA1660 merged 3 commits into
AlienTechSoftware:mainfrom
DWAA1660:feat/collect-all/23

Conversation

@DWAA1660

Copy link
Copy Markdown
Collaborator

Closes #23.

What changes

A Collect All button at the end of the Draw tab's Edit group pulls the boxes and strokes of ink that drifted apart on the open canvas back into a close group.

  • Along each axis, every empty stretch of the page wider than a small gap (24 pt), including the margin before the first item, is closed down to that gap. Nothing else moves.
  • Items keep their order across and down the page, and nothing ends up on anything it was not already on, because only empty bands are removed.
  • Ink drawn over a box moves with that box, so annotations stay on their notes.
  • One Undo puts the boxes and the ink back. The gathered layout is saved like any other box move.
  • The view jumps to the page's top left afterwards, so the gathered page is in view.

Code

  • crates/ui-egui/src/collect.rs: gather(items, gap), the geometry, with unit tests for far-apart items, small gaps, overlap safety, ordering and junk input.
  • containers::Moved.frames: each box's frame in page points (normal and ink views).
  • inkpad::Pad::stroke_bounds / move_each.
  • docs/gaps.md describes the command under Pen and drawing.

Tests

  • UI test collect_all_gathers_boxes_and_ink_that_drifted_apart puts two boxes at (40,20) and (3000,2500) and draws one stroke far down the page. It then runs Collect All and checks:
    • the first box only loses its margin, the far box comes back without overlapping the first, and the stroke comes closer;
    • the page file keeps the new layout;
    • one Undo restores both the boxes and the ink.
  • The button sits after Format Background so the existing Draw-tab controls keep their places. An earlier placement pushed Format Background off the 1200 px test window.
  • cargo xtask ci passes locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y4im4nvZvQHZdShop1ff8w

DWAA1660 and others added 3 commits November 13, 2026 18:04
…chSoftware#23)

A Collect All button at the end of the Draw tab's Edit group pulls the
boxes and strokes of ink that drifted apart on the open canvas back
together. Along each axis, every empty stretch of the page wider than a
small gap (24 pt), including the margin before the first item, is closed
down to that gap. Nothing else moves. Items keep their order across and
down the page, and nothing ends up on anything it was not already on. Ink
drawn over a box moves with the box, so notes keep their annotations.

One Undo puts the boxes and the ink back together. The new layout is
written to the page like any other box move.

collect.rs holds the geometry, with unit tests. containers::Moved now
reports each box's frame in page points, and inkpad::Pad gains
stroke_bounds and move_each.

Closes AlienTechSoftware#23

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y4im4nvZvQHZdShop1ff8w
@DWAA1660
DWAA1660 merged commit 476c505 into AlienTechSoftware:main Nov 14, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Collect All Drawings in Infinite Canvas

1 participant