Complete multiline command and properties behavior

This commit is contained in:
ramox81 2026-08-22 20:20:34 +03:00
commit 2263168a2a
9 changed files with 870 additions and 238 deletions

View file

@ -662,6 +662,29 @@ impl OpenCADStudio {
tab.dirty = true;
}
}
let mline_settings = self.tabs[self.active_tab]
.active_cmd
.as_ref()
.and_then(|command| command.mline_settings());
if let Some((scale, justification, style_name, style_handle)) = mline_settings {
let tab = &mut self.tabs[self.active_tab];
let header = &mut tab.scene.document.header;
let changed = (header.multiline_scale - scale).abs() > f64::EPSILON
|| header.multiline_justification != justification
|| !header.multiline_style.eq_ignore_ascii_case(&style_name)
|| style_handle.is_some_and(|handle| {
header.current_multiline_style_handle != handle
});
if changed {
header.multiline_scale = scale;
header.multiline_justification = justification;
header.multiline_style = style_name;
if let Some(handle) = style_handle {
header.current_multiline_style_handle = handle;
}
tab.dirty = true;
}
}
let was_active = self.tabs[self.active_tab].active_cmd.is_some();
let preserve_selection =
matches!(result, CmdResult::Relaunch(..) | CmdResult::Dispatch(..));