Repository navigation
Canvas: double-clicking type with a selection tool puts the caret there - #284
Merged
bflatastic merged 2 commits intoOct 7, 2026
Merged
Conversation
… typed
egui reports the character a key types, so Cmd+Shift+[ arrives as
Cmd+Shift+{ (], / likewise as }, ?) and Shift+` as the text ~, and these
default shortcuts never matched: Bring to Front, Send to Back, Search
Commands and the Curvature tool. Command chords now also take the
shifted character, single-key tool and command shortcuts also look up
Shift+<typed text>, and the Keyboard Shortcuts editor records such a
chord as its key (Cmd+Shift+], not Cmd+Shift+}), so conflicts show.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e caret there The Selection tool's double-click on text only switched to the Type tool, which then had nothing being edited, so typing went to the tool shortcuts (X swapped the text's fill and stroke). After such a switch the canvas passes the double-click on to the Type tool as a click, which starts editing the type with the caret where it was clicked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bflatastic
force-pushed
the
fix/double-click-type-caret
branch
from
October 7, 2026 06:30
4f985ed to
11799fa
Compare
Member
|
Thanks @theironchef, merged! I rebased it on main (both canvas tests kept next to the others) and added an "Editing type" line to the ROADMAP. Live check: a double-click on "Hello world" with the Selection tool switched to the Type tool with the caret at 6, and typing X gave "Hello Xworld" instead of swapping fill and stroke. |
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 #283.
Problem: the Selection tool's double-click on type returns only
SwitchTool("type")(crates/tools/src/select.rs), so the Type tool started idle, with nothing being edited and no caret. Typing right after went to the shortcut handler instead of the text. X, for one, swapped the selected text's fill and stroke and turned it into outlined type.Change: in
handle_input(crates/ui-egui/src/canvas.rs), when a double-click switches the tool to Type, the canvas passes the double-click's position on to the Type tool as a click (Down + Up). A click on existing type already starts editing it with the caret at the clicked character (edit_at), so typing edits the text straight away, as in the reference app. Other double-clicks are unchanged: group isolation, exiting isolation, and the Type tool's own word selection.Tests
canvas::tests::double_clicking_type_with_the_selection_tool_puts_the_caret_there: a headless double-click in the middle of "Hello world" with the Selection tool leaves the Type tool editing that text, with the caret strictly inside it. Typing X then inserts at the caret.cargo test -p vectorcraft-ui-egui: 557 passed.cargo test -p vectorcraft-engine --lib persp_text: 12 passed (perspective type's double-click path).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