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

+12 -3
View File
@@ -1,4 +1,7 @@
use gpui::{App, Hsla, IntoElement, ParentElement, Pixels, RenderOnce, Styled, Window, div};
use gpui::{
App, Hsla, InteractiveElement, IntoElement, ParentElement, Pixels, RenderOnce, Styled, Window,
div,
};
use super::{
edit::Handle,
@@ -8,7 +11,7 @@ use super::{
use crate::theme::ActiveTheme;
/// A box in view pixels as an absolute element.
fn placed(frame: &Frame) -> gpui::Div {
pub(super) fn placed(frame: &Frame) -> gpui::Div {
div()
.absolute()
.left(Pixels::from(frame.x))
@@ -73,7 +76,13 @@ impl RenderOnce for TransformHandles {
let side = f32::from(theme.canvas().handle.to_pixels(window.rem_size()));
let squares = handle_boxes(&self.frame, side)
.into_iter()
.map(move |(_, frame)| placed(&frame).bg(surface).border_1().border_color(accent));
.map(move |(handle, frame)| {
placed(&frame)
.bg(surface)
.border_1()
.border_color(accent)
.debug_selector(move || format!("handle {handle:?}"))
});
div()
.absolute()
.inset_0()