feat: Implement in-place MText editor with formatting toolbar and live preview
- Added SVG icons for text formatting options (bold, italic, underline, overline, strike, uppercase, lowercase). - Introduced a new `MTextEditorState` struct to manage the state of the MText editor. - Implemented functionality to open the MText editor from the command line and edit existing MText entities. - Added message handling for various MText editor actions (formatting, height, style, font, justification, alignment, line spacing). - Created a dedicated preview area for MText rendering within the editor. - Updated the command structure to support opening the MText editor and handling text input. - Refactored existing MText command logic to integrate with the new editor.
This commit is contained in:
parent
e2507d5c54
commit
de08bd598c
20 changed files with 871 additions and 36 deletions
|
|
@ -1496,6 +1496,16 @@ impl OpenCADStudio {
|
|||
self.tabs[i].scene.clear_preview_wire();
|
||||
self.restore_pre_cmd_tangent();
|
||||
}
|
||||
CmdResult::OpenMTextEditor {
|
||||
pos,
|
||||
handle,
|
||||
initial,
|
||||
height,
|
||||
} => {
|
||||
self.tabs[i].active_cmd = None;
|
||||
self.tabs[i].snap_result = None;
|
||||
self.open_mtext_editor(pos, handle, &initial, height);
|
||||
}
|
||||
CmdResult::DdeditEntity { handle, new_text } => {
|
||||
let mut updated = false;
|
||||
if let Some(entity) = self.tabs[i].scene.document.get_entity_mut(handle) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue