mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-27 19:27:21 -06:00
Fix #219: right-click on the canvas opens a context menu
Right-clicking the canvas now opens a context menu, as the reference app does. The object under the pointer is selected first unless it already is. The menu then lists what applies to the selection: Undo and Redo, Cut, Copy, Paste, Isolate Selected Group or Exit Isolation Mode, Group and Ungroup, Join and Average, Make or Release Clipping Mask and Compound Path, Make Guides, the Transform, Arrange and Select submenus, and Export Selection. On empty canvas it lists Paste, the zoom commands, the ruler, grid and guide toggles and Select All. Commands that can't run now are left out (Undo and Redo stay, greyed out), and a press on the canvas only closes the menu. Agents list the same menu with the `ui.contextMenu.list` control method. Root cause: the canvas ignored the secondary button except in the toolbar's tool flyouts; there was no context menu at all. The menu reuses the menu bar's items, rendering and dispatch; Object > Transform and Arrange are now shared lists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
2f743f155f
commit
cdb734aede
@@ -10,6 +10,7 @@
|
||||
| `document.inspect` | | layer tree, selection, history, paint defaults |
|
||||
| `ui.inspect` | | tool, UI state, view, canvas rect, window size, perf, background saves and exports still running |
|
||||
| `ui.menu.list` / `ui.menu.invoke` | `{command, params}` | the full menu tree / invoke an item |
|
||||
| `ui.contextMenu.list` | | the canvas context menu for the current selection, flattened like `ui.menu.list` (`path` holds its submenus). `ui.click {x, y, button: "right"}` on the canvas opens it, after selecting the object there unless it is already selected |
|
||||
| `ui.tool.select` / `ui.tool.list` | `{tool}` | |
|
||||
| `ui.pointer` | `{events:[{kind: down|drag|up|move|doubleclick, x, y, space?: "doc"|"screen", mods?}]}` | drive the active tool exactly like the mouse |
|
||||
| `ui.key` / `ui.text` | `{key, shift?, alt?, cmd?}` / `{text}` | synthetic keyboard input |
|
||||
|
||||
Reference in New Issue
Block a user