fix(ui): a shape just drawn resizes from its handles without the Select tool (#2362)

Drawing a rectangle or oval selects it and paints its eight handles, but only the Select tool
answered them: with the shape tool still on, dragging a handle drew a second shape on top of the
first. The handles were a promise the tool did not keep, and anyone marking up a drawing had to
switch tools after every shape to fix its size.

A shape tool now hands a press on the selected comment's handles to the same select_input the
Select tool uses, as the Fill & Sign tools already do for their marks. Only the handles: a drag
anywhere else, over the shape included, still draws, so drawing one shape inside another keeps
working, and a polygon being clicked out keeps its clicks. The Eraser is left out. The handle
test is shared with `grabs` rather than copied.

Lines, arrows and polygons are unchanged: they have no resize handles with the Select tool
either.

Fixes storytold/pdfcraft#2338


Claude-Session: https://claude.ai/code/session_01DsT1y8xBvkXeBxEUQqdDtj

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
cortenburg28-arch
2026-10-15 02:57:54 -04:00
committed by GitHub
co-authored by Claude
parent 21e7903ff2
commit 00442a0e9b
3 changed files with 62 additions and 8 deletions
+2 -2
View File
@@ -3745,8 +3745,8 @@ milestone = "M5"
status = "shipped"
commands = ["comment.square"]
tools = ["comment_add", "comment_edit"]
evidence = ["crates/ui-egui/tests/comments.rs::shapes_and_ink_are_drawn_by_dragging", "crates/annot/src/tests.rs::restyle_and_resize_redraw_the_appearance", "crates/annot/src/tests.rs::shapes_can_be_filled_and_unfilled", "crates/ui-egui/tests/comments.rs::shapes_take_a_fill_colour_from_the_quick_bar_and_properties"]
notes = "resize with the 8 handles; fill colour or no fill (#686) from the quick bar, Properties and comment_edit `fill`; fill swatches are the comment palette only (no custom colour picker yet)"
evidence = ["crates/ui-egui/tests/comments.rs::shapes_and_ink_are_drawn_by_dragging", "crates/annot/src/tests.rs::restyle_and_resize_redraw_the_appearance", "crates/annot/src/tests.rs::shapes_can_be_filled_and_unfilled", "crates/ui-egui/tests/comments.rs::shapes_take_a_fill_colour_from_the_quick_bar_and_properties", "crates/ui-egui/tests/comments.rs::a_shape_just_drawn_resizes_from_its_handles_without_the_select_tool"]
notes = "resize with the 8 handles, straight after drawing with the tool still on (#2338); fill colour or no fill (#686) from the quick bar, Properties and comment_edit `fill`; fill swatches are the comment palette only (no custom colour picker yet)"
[[feature]]
id = "comment.oval"