forked from 1b-agent/opencadstudio-upstream
feat: Implement in-place MText editor with formatting toolbar and live preview
MTEXT (and double-clicking an MText) now opens an in-place editor anchored at the insertion point instead of typing a single line on the command line. The editor has a two-row formatting toolbar: text style / font / height, bold, italic, underline, overline, strike, upper/lowercase and a colour dropdown on top; oblique angle, width factor, character spacing, paragraph alignment, justification, line spacing and OK/Cancel below. Character toggles wrap the selection in DXF inline codes; global fields apply as leading runs or entity properties. Editing is shown in the editor's own area, not on the drawing: a Code/Preview toggle switches between the raw text input and a rendered preview canvas that draws the tessellated glyph strokes at real size, scrolling when the text outgrows the view. The MText box keeps a fixed width so text wraps to the next line instead of stretching into one line. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
de08bd598c
commit
a5ad0666ce
4 files changed
+75
-43
No files matched your search
@@ -737,6 +737,8 @@ pub enum Message {
|
||||
MTextAlign(mtext_editor::ParaAlign),
|
||||
/// Toolbar line-spacing change.
|
||||
MTextLineSpacing(f32),
|
||||
/// Toggle the editor between the raw code input and the rendered preview.
|
||||
MTextTogglePreview,
|
||||
/// Commit the editor: create or update the MText entity.
|
||||
MTextOk,
|
||||
/// Discard the editor without creating / changing the entity.
|
||||
|
||||
Reference in new issue
Block a user