Repository navigation
Symbols panel: drag art in to make a symbol, drag a symbol out to place it - #288
Merged
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>
Art dragged off the canvas and released over the Symbols panel's list becomes a new symbol (symbol.new with the dragged ids), and a symbol dragged out of the panel (PanelDrag::Symbol) is placed on the canvas centred where it is dropped (symbol.place), showing its thumbnail at the pointer on the way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bflatastic
force-pushed
the
fix/symbols-drag-and-drop
branch
from
October 7, 2026 06:30
bd8f11c to
bc688bd
Compare
Member
|
Thanks @theironchef, merged! I rebased it on main and made two small changes:
Live check in the app: dragging a selected rectangle onto the Symbols panel made "New Symbol" with the rectangle as its instance, and dragging the tile out placed an instance centred exactly at the drop point. The Swatches and Brushes drops you listed are good follow-ups. |
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 #285.
Problem: the Symbols panel (
crates/ui-egui/src/panels/symbols.rs) took no drag and drop in either direction.PanelDrag::Art, which the Graphic Styles and Asset Export panels accept) was ignored when released over it.Both are the reference app's usual ways to make and to place a symbol.
Change
symbol.new {ids}, which makes the symbol and replaces the art with an instance, like New Symbol. It uses the same pattern as Asset Export'sdrop_zone.PanelDrag::Symbol(name).canvas::panel_dropplaces it withsymbol.place {name, x, y}, centred at the drop point, on empty canvas as well as on art (its hit test runs after this case). On the way, the pointer shows the symbol's thumbnail through the sharedpointer_chip(newsymbols::chip).PanelDragmatches (Graphic Styles' drop zone, the Swatches drag preview) cover the new variant.Tests
panels::symbols::tests::art_dropped_on_the_panel_becomes_a_symbol_and_a_symbol_drags_out, a headless panel:PanelDrag::Symbolwith its name.canvas::tests::a_symbol_dropped_on_the_canvas_is_placed_there: a symbol released over empty canvas gives a selected instance of it, centred at the drop point.cargo test -p vectorcraft-ui-egui: 558 passed.cargo clippy -p vectorcraft-ui-egui --all-targets -- -D warnings(Rust 1.99): clean.cargo fmt --all -- --check: clean.Follow-ups not in this PR: the reference app also takes art dropped on the Swatches panel (a pattern swatch) and the Brushes panel (a new brush), and a brush dragged onto a path.
I didn't run the full
cargo xtask ci(wasm step) here.🤖 Generated with Claude Code