Repository navigation
Canvas: Ctrl with another tool drags with the selection tool used last - #276
Merged
Merged
Conversation
Dragging a bounding-box handle of area type with the Selection tool now
resizes the type area: the text reflows at its own size (threads too)
instead of being scaled, and History says "Resize Type Area". With other
objects selected they scale as before while the area type resizes its
frame. Direct Selection picks the frame's corners and edges and reshapes
the area ("Reshape Type Area", new command text.reshapeArea), and the
selected frame's anchors and outline show. Area Type Options gains Width
and Height. Point type, rotation, Object > Transform > Scale, the Scale
tool and the Transform panel still transform the type.
Root cause: every handle drag previewed object.transform, which folds the
matrix into the text's xf (TextObject::transform), so area type scaled its
glyphs; and Direct Selection's anchor hit test only looked at paths, so the
frame's corners could not be picked. object.transform now takes
typeAreas, which reshapes the frame in text space (xf^-1 * m * xf), and
the tools use it and text.reshapeArea.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ol used last The canvas always switched to the Selection tool for a Cmd press with a non-selection tool. The UI state now remembers which of Selection, Direct Selection and Group Selection was used last, and the temporary switch uses it, so Cmd-dragging an anchor while drawing with the Pen after using Direct Selection moves that anchor, not the whole path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bflatastic
force-pushed
the
fix/temp-selection-tool
branch
from
October 7, 2026 06:12
2eba7cd to
47104f5
Compare
Member
|
Thanks @theironchef, merged! I rebased it on main (it now sits with #279, whose canvas test landed right next to yours) and added a ROADMAP line ("Temporary tools"). I also checked it live in the app: with the Pen tool, a Cmd-drag on a corner moved just that anchor when Direct Selection was used last, moved the whole object when Selection was, and the Pen tool came back afterwards. |
This was referenced Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #270.
Problem: on a Cmd press with any tool outside the selection family,
handle_input(crates/ui-egui/src/canvas.rs) switched to the Selection tool for the drag. In the reference app it's the selection tool used last. So with the Pen tool, after using Direct Selection, a Cmd-drag on an anchor moved the whole path instead of that anchor.Change
UiStategetslast_selection_tool, default"selection".VectorcraftApp::select_toolsets it whenever Selection, Direct Selection or Group Selection becomes the tool. It's covered by the struct's#[serde(default)].canvas::is_selection_tool, which the canvas andselect_toolshare.Tests
canvas::tests::cmd_with_another_tool_drags_with_the_selection_tool_used_last, a headless canvas test with Cmd held (viaEvent::ModifiersChanged) while the Pen tool is active:select_tool("selection"), the test fails (left: "selection" right: "directSelection").cargo test -p vectorcraft-ui-egui: 555 passed.cargo clippy -p vectorcraft-ui-egui --all-targets -- -D warnings(Rust 1.99): clean.cargo fmt --all -- --check: clean.I didn't run the full
cargo xtask ci(wasm step) here.🤖 Generated with Claude Code