Skip to content

Artboards: art centered on an artboard's right or bottom edge is on that artboard - #2637

Merged
bflatastic merged 2 commits into
storytold:mainfrom
dotCooCoo:fix/art-on-artboard-edge
Oct 17, 2026
Merged

bflatastic merged 2 commits into
storytold:mainfrom
dotCooCoo:fix/art-on-artboard-edge

Conversation

@dotCooCoo

@dotCooCoo dotCooCoo commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Make two artboards side by side, draw a vertical line along the right edge of the second one, and run Object ›
Artboards › Rearrange All Artboards… with Arrange by Row and Change to Right-to-Left Layout. On main both artboards
move and the line stays behind. A line along an artboard's bottom edge stays behind too, and Select › All on Active
Artboard selects neither line.

Rearrange, All on Active Artboard (for objects with no area), Paste in Place's source artboard, Align to Artboard
without an index, Crop Image and its tool, file.place with at, CSS positions, a filter plug-in's artboard and the
Artboard tool decide whether a point is on an artboard with Rect::contains, which leaves out the right and bottom
edges. Document::art_on_artboard counts art flush with those edges (#890).

They now use that rule, edges included, within a millionth of a point (artboard_holds and
Document::artboard_holding). On an edge two artboards share, the artboard to the right of it or below it still holds
the point, except at an end of the edge that lies on that artboard's own bottom or right edge; there the first
artboard holds it. All on Active Artboard now selects a line on a shared edge from either artboard. A press exactly on a right
or bottom edge picks that artboard.

How it was tested

Seven new tests cover the change: tests::artboard_at_counts_the_right_and_bottom_edges (doc), and Rearrange, All on
Active Artboard, Paste in Place, placed type, CSS positions and the Artboard tool's cursor and click in tests_newdoc,
tests_menucmds, tests_clipboard, tests_textimport, css_rules and xform::artboard.

With the call sites reverted to main's containment check, all seven fail. Targeted checks: clippy with -D warnings
on the doc, svg, tools and engine crates, cargo fmt --all -- --check, the doc and tools tests (213 and 376 passed),
css_rules (9 passed), 216 engine tests, 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,371 tests passed, 0 failed, 11 ignored.

git merge-tree reports no conflicts with main at 49bdc5c; on that merge, cargo check --workspace --tests, the
xform::artboard tests (13 passed), cargo xtask brands and cargo xtask cursors pass. It conflicts with #2614 on the Rearrange and All on Active
Artboard lines; the resolution keeps #2614's measurement and this branch's edge check. It conflicts with #2592 and #2497
on the Artboard tool's cursor line. #2592's version already calls artboard_at. For #2497, the resolution is
!m.shift && cx.doc.artboard_at(p).is_some().

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.

…hat artboard

Rearrange All Artboards, Select › All on Active Artboard (for objects
with no area), Copy's source artboard for Paste in Place, Align to
Artboard without an index, Crop Image, the Crop Image tool, Place with
`at`, CSS positions and a filter plug-in's artboard decided whether a
point or an object's center is on an artboard with Rect::contains,
which leaves out the right and bottom edges. A line along an artboard's right or
bottom edge was on no artboard: Rearrange left it behind, and All on
Active Artboard did not select it. Document::art_on_artboard counts
art flush with those edges (storytold#890).

They now count the edges as art_on_artboard does, within a millionth
of a point. On an edge two artboards share, the artboard to the right
of it or below it still holds the point. All on Active Artboard
selects a line on a shared edge from either artboard. A press exactly
on a right or bottom edge now picks that artboard, and the Artboard
tool's cursor shows Move there.
… holds

On an edge two artboards share, the artboard to the right of it or below
it holds a point, except at the end of the edge that lies on that
artboard's bottom or right edge, such as where both artboards' bottom
edges meet. There the first artboard holds it, or the last when
topmost. The doc comment and the test comments now say so, and the test
asserts that corner.
@bflatastic
bflatastic force-pushed the fix/art-on-artboard-edge branch from 52e1018 to 24b6486 Compare October 17, 2026 10:15
@bflatastic
bflatastic merged commit e7e149a into storytold:main Oct 17, 2026
bflatastic added a commit to dotCooCoo/vectorcraft that referenced this pull request Oct 17, 2026
@bflatastic

Copy link
Copy Markdown
Member

Thanks @dotCooCoo, merged, including your doc-comment and shared-corner test commit. It met #2614 in Rearrange and Select All on Active Artboard: symbol instances are measured by their art and the artboard is found with your artboard_holding / artboard_holds. #2665 now uses the same helpers instead of its own copies. 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