Edit sketch text content and placement from its outlines (#253)
* Expose interactive editing and placement of sketch text * Respect document units when editing sketch text * Route Edit Text through the shared feature dialog The sketch text editor is now a Kind::Text dialog opened through Dialog::for_command (frame.rs docking, standard OK/Cancel, Enter/Esc). Its fields are ordinary dialog fields: they take expressions, parameters and units, and bare lengths are in the design's units. Untouched fields keep their exact saved values. The dialog stays open across unrelated design changes and closes only when its text is gone, the sketch ends, or another command starts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RjGw4gA5ZvKrU8MQP6sBgT --------- Co-authored-by: bherbruck <brennen.herbruck@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
7 files changed
+461
-2
No files matched your search
@@ -95,6 +95,7 @@ mod sketch_display_ui_tests;
|
||||
#[cfg(test)]
|
||||
mod sketch_edit_tests;
|
||||
pub mod sketch_palette;
|
||||
pub(crate) mod sketch_text;
|
||||
pub mod sketch_tools;
|
||||
pub mod stand_up;
|
||||
pub mod theme;
|
||||
@@ -483,6 +484,10 @@ impl SolveApp {
|
||||
/// Start a command the way a toolbar click does: interactive tools and dialogs for commands
|
||||
/// that have them, otherwise run it with defaults.
|
||||
pub fn start(&mut self, id: &str) {
|
||||
// Another command ends Edit Text (its dialog is not a feature edit to keep).
|
||||
if sketch_text::editing(self) {
|
||||
dialogs::cancel(self);
|
||||
}
|
||||
// A component moved without Capture Position: ask first (Capture, Revert or Cancel).
|
||||
if browser::needs_capture(self, id) && !(id == "sketch.dimension" && self.session.active_sketch.is_some()) {
|
||||
self.tree.capture_prompt = Some(id.to_string());
|
||||
@@ -663,6 +668,9 @@ impl SolveApp {
|
||||
/// Finish the active sketch: stop editing, restore the history marker Edit Sketch moved and
|
||||
/// return to the view from before the sketch.
|
||||
pub fn finish_sketch(&mut self) {
|
||||
if sketch_text::editing(self) {
|
||||
dialogs::cancel(self);
|
||||
}
|
||||
dim_view::cancel();
|
||||
self.tool = None;
|
||||
let _ = self.run("sketch.finish", json!({}));
|
||||
|
||||
Reference in new issue
Block a user