Canvas · Tools: single handles, a wrapping palette, the pen ends with its tool

Handles resize one shape, so a selection of several shows its outline
and no handles; a press there no longer falls through to a marquee.
ToggleGroup wraps its faces when narrow, so the ToolPalette stays in a
280px box. A pen path left open ends when the tool changes: two points
or more go to the owner after the frame, a lone point is dropped, and
the open path paints only while the pen is the tool.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-09-27 07:41:10 -04:00
1 parent 49a205ea35
commit b55c81d994
6 files changed
+139 -23

No files matched your search

+4 -2
View File
@@ -105,9 +105,10 @@ fn toggle_face(
let colors = &theme.colors;
let (text, icon_size) = label_size(size);
let fg = if on { colors.fg } else { colors.fg_muted };
let hover = colors.hover;
let (hover, value) = (colors.hover, item.value.clone());
div()
.id(id)
.debug_selector(move || format!("toggle {value}"))
.flex()
.flex_none()
.items_center()
@@ -194,7 +195,7 @@ impl RenderOnce for ToggleButton {
type OnChange = Rc<dyn Fn(&[SharedString], &mut Window, &mut App)>;
/// Toggles side by side. One is chosen, or several with `multiple`.
/// Toggles side by side, wrapping onto more lines when narrow. One is chosen, or several with `multiple`.
#[derive(IntoElement)]
pub struct ToggleGroup {
id: ElementId,
@@ -280,6 +281,7 @@ impl RenderOnce for ToggleGroup {
div()
.id(self.id)
.flex()
.flex_wrap()
.items_center()
.gap_0p5()
.p_0p5()