fix(mtext): show preview glyphs and make Enter break the line
Two defects in the in-app MTEXT editor, both surfaced once the preview text became visible: 1. Invisible preview text. After the SDF text migration, tessellate emits glyphs as SDF quads on `text_verts` and leaves the polyline `points` empty, but the editor preview draws on a 2D canvas that can't run the SDF shader — so only the selection box showed. Add a `force_text_strokes` parameter to tessellate: when set, TEXT/MTEXT run-groups also emit their glyph outline strokes as points. The preview passes true (real stroke font, aligned with glyph_boxes); every other caller passes false and keeps SDF-only text. 2. Enter did not start a new line. mtext_type inserted a literal newline, but the MTEXT layout only breaks on the `\P` code (a raw 0x0A is a break only to the caret logic). Normalise every literal newline — from Enter or a multi-line paste — to `\P`, so the line breaks and the saved value stays standard. Closes #308 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
cf4074b0f2
commit
d37dabb0fb
6 changed files with 33 additions and 2 deletions
|
|
@ -204,6 +204,7 @@ pub(crate) fn tessellate_entity(
|
|||
1.0,
|
||||
world_per_pixel,
|
||||
bg_color,
|
||||
false,
|
||||
);
|
||||
let ab = entity_aabb(e);
|
||||
for w in &mut wires {
|
||||
|
|
@ -594,6 +595,7 @@ pub(crate) fn tessellate_entity(
|
|||
anno_scale,
|
||||
world_per_pixel,
|
||||
bg_color,
|
||||
false,
|
||||
);
|
||||
for w in &mut wires {
|
||||
w.name = h.value().to_string();
|
||||
|
|
@ -654,6 +656,7 @@ pub(crate) fn tessellate_entity(
|
|||
anno_scale,
|
||||
world_per_pixel,
|
||||
bg_color,
|
||||
false,
|
||||
);
|
||||
for b in &mut bases {
|
||||
b.aci = aci;
|
||||
|
|
|
|||
Loading…
Reference in a new issue