Skip to content

Fix #541: a click on a selected object makes it the key object - #565

Merged
bflatastic merged 1 commit into
mainfrom
fix/issue-541
Oct 8, 2026
Merged

bflatastic merged 1 commit into
mainfrom
fix/issue-541

Conversation

@bflatastic

Copy link
Copy Markdown
Member

A click on an object of a multi-object selection makes it the key object, which Align then aligns to.

  • Selection tool (crates/tools/src/select.rs): a press and release without a drag or modifier, on one object of a selection of several, runs select.key {id}. Clicking the key again runs select.key {}. Drags, Shift-clicks and single selections behave as before.
  • Canvas: the key object's outline is drawn 2.5 px wide (its bounds when it has too many paths to outline).
  • Align panel: shows Align to Key Object while there is a key. Choosing Align to Selection or Artboard lets the key go. Cancel Key Object is enabled while there is a key.
  • Engine: object.align without to aligns to the key when there is one, so the Control bar, Properties panel and menu Align buttons follow it. object.distributeSpacing with a spacing keeps the key still and spaces the others from it. It now errors on fewer than two measurable objects instead of indexing an empty list. Command docs updated for select.key, object.align and object.distributeSpacing. New message rows in es and it.
  • Tests: tool clicks set and clear the key (drag and lone object unaffected); an engine end-to-end click → align → distribute spacing → click-again; the Align panel follows the key; the canvas draws the thicker outline.
  • ROADMAP Last updated.

Checked live: with two shapes selected, a click on the ellipse draws it with the thick outline, and the Align panel switches to Align to Key Object with the spacing field enabled.

Checks

  • Rebased on origin/main 2b321d2.
  • cargo test -p vectorcraft-tools -p vectorcraft-engine -p vectorcraft-ui-egui, cargo clippy on those crates with --all-targets -- -D warnings, cargo fmt --all, cargo xtask wasm, i18n tests.

🤖 Generated with Claude Code

With the Selection tool, a click (no drag, no modifier) on one object of a
selection of several makes it the key object (select.key); a click on the
key again lets it go. The key object is drawn with a thicker outline,
Align aligns to it (the Align panel shows Align to Key Object while there
is a key, and choosing Selection or Artboard lets it go), and
object.align without `to` aligns to the key when there is one, so the
Control bar's and the Properties panel's Align buttons do too. With a
spacing, Distribute Spacing keeps the key object still and spaces the
others from it, and it reports too few objects instead of indexing an
empty list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant