fix(ui): preserve construction tools and dashed feedback (#600)

Construction (X) keeps the active sketch tool, its picked points and inline values while switching line type, and drawing previews and hover show the same dashed pattern as committed construction and centre lines. Fixes #584 and #581.

Co-authored-by: lillith <35337584+0xlillith@users.noreply.github.com>
This commit is contained in:
selune authored and GitHub committed 2026-10-13 04:07:48 -04:00
1 parent db02a18627
commit 083ddf7722
7 files changed
+163 -37

No files matched your search

+6 -6
View File
@@ -511,6 +511,12 @@ impl SolveApp {
self.tree.capture_prompt = Some(id.to_string());
return;
}
// A line-type toggle changes the current drawing, including a partly picked shape.
// Handle it before cancelling tools or inline dimensions.
if id == "sketch.construction" {
sketch_palette::toggle_construction(self);
return;
}
dim_view::cancel();
self.tool = None;
self.home.open = false;
@@ -542,12 +548,6 @@ impl SolveApp {
let edges = self.session.selection.iter().any(|s| matches!(s, solidcraft_engine::Sel::Edge { .. }));
return self.start(if edges { "solid.fillet" } else { "solid.extrude" });
}
// Construction toggle: selected sketch curves switch at once, otherwise pick them.
// Construction (X): convert the selection, or switch construction mode; no pick tool.
if id == "sketch.construction" {
sketch_palette::toggle_construction(self);
return;
}
if let Some(spec) = solidcraft_engine::find_command(id)
&& (tools::Tool::for_command(id).is_some() || dialogs::Dialog::for_command(self, id).is_some())
&& id != "sketch.create"