Skip to content

Artboards: Rearrange and Select All on Active Artboard measure a symbol instance by its art - #2614

Merged
bflatastic merged 1 commit into
storytold:mainfrom
dotCooCoo:fix/artboard-art-symbol-bounds
Oct 17, 2026
Merged

bflatastic merged 1 commit into
storytold:mainfrom
dotCooCoo:fix/artboard-art-symbol-bounds

Conversation

@dotCooCoo

Copy link
Copy Markdown
Contributor

What and why

On main, Object › Artboards › Rearrange All Artboards and Select › All on Active Artboard measure a symbol instance
as its transform applied to the 20 × 20 square around the symbol's origin, not by the symbol's art. Place an instance
of a symbol whose art lies away from its origin so that the art is on artboard 2 and the square is on artboard 1:
Rearrange moves the instance with artboard 1, and All on Active Artboard selects it on artboard 1 and not on
artboard 2. Convert to Artboards, Transform Each, Lock and Hide › All Artwork Above, Paste and Place from Library at a
point, and the clipboard.import* commands measure the instance the same way, as do Copy and Cut when they record the
source artboard and library.add when it sizes a graphic.

These commands now measure an instance by its art through Document::symbol_boxes, as Document::art_on_artboard
(crates/doc/src/lib.rs:1303), Fit to Artwork Bounds and the Align commands do. Clipboard::bounds uses the
symbols the clipboard holds. clipboard.exportPng, clipboard.exportPdf and the PNG and PDF that Copy offers other
apps are now cropped to the instance's art. docs/mcp.md lists the commands.

How it was tested

Ten new tests in tests_symbolbounds run Rearrange, All on Active Artboard, Convert to Artboards, Transform Each,
Lock and Hide › All Artwork Above, Copy, Paste in Place, Paste at a point, clipboard.importSvg,
clipboard.exportPng, library.add and library.use on an instance whose art lies away from its symbol's origin.

With every changed measurement put back to the square, the ten tests fail and the 15 older ones in the file pass.
Targeted checks: cargo clippy -p vectorcraft-engine --all-targets -- -D warnings, cargo fmt --all -- --check,
CRAFT_FONTS_DIR=<craft-fonts checkout> cargo test -p vectorcraft-engine --lib -- tests_symbolbounds:: tests_menucmds:: tests_clipboard:: tests_clipflavours:: tests_newdoc:: tests_journal:: tests_library:: symbol (221 passed), and
cargo xtask brands, layers and assets.

On Windows 11 (x86-64) with rustc 1.99.0, on top of main at 8bc6532:

  • CRAFT_FONTS_DIR=<craft-fonts checkout> cargo xtask ci passes its 9 steps: 7,374 tests passed, 0 failed, 11 ignored.

git merge-tree reports no conflicts with main at 8bc6532. With #2592, the comment above Rearrange's art walk in
crates/engine/src/cmd/menucmds.rs conflicts: keep #2592's walk through sublayers and its locked-artboard filter, and
this branch's symbol_boxes line.

Checklist

  • cargo xtask ci passes (fmt, clippy, tests, assets, brands, layers, wasm).
  • No panics in shipped code: no unwrap(), expect(), panic!, unreachable!, todo! or
    unimplemented! outside tests, and no unchecked indexing on data from files, parameters or
    messages. Errors are returned as Result and shown to the user
    (why and how).
  • Clean-room: nothing copied from Adobe products or GPL/AGPL code (AGENTS.md).
  • Every new asset has a row in ASSETS.md.

…ol instance by its art

Rearrange and Select › All on Active Artboard measured a symbol
instance as its transform applied to the 20 × 20 square around the
symbol's origin, not by the symbol's art. An instance whose art lies
away from that square moved with, or was selected on, the artboard
the square was on. Convert to Artboards, Transform Each, Lock and
Hide › All Artwork Above, Paste and Place from Library at a point,
and the clipboard imports measured the instance the same way, as did
Copy and Cut when they recorded the source artboard and library.add
when it sized a graphic.

These commands now measure an instance by its art through
Document::symbol_boxes, as Document::art_on_artboard, Fit to Artwork
Bounds and the Align commands do. Clipboard::bounds measures with the
symbols the clipboard holds. clipboard.exportPng, clipboard.exportPdf
and the PNG and PDF that Copy offers other apps are now cropped to
the instance's art.

Docs: docs/mcp.md.
@bflatastic
bflatastic force-pushed the fix/artboard-art-symbol-bounds branch from 9a011a8 to 67b47c7 Compare October 17, 2026 10:12
@bflatastic
bflatastic merged commit fa4e427 into storytold:main Oct 17, 2026
@bflatastic

Copy link
Copy Markdown
Member

Thanks @dotCooCoo, merged. It went through the full gate (fmt, clippy, tests, layers, wasm) in a batch with the other PRs landed today.

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.

2 participants