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
2
src/scene/cache/block_cache.rs
vendored
2
src/scene/cache/block_cache.rs
vendored
|
|
@ -419,7 +419,7 @@ fn tessellate_sub_local(
|
|||
// before casting to f32 — same precision-preservation trick used for
|
||||
// top-level entities, applied per-defn.
|
||||
let wires_out = tessellate::tessellate(
|
||||
doc, h, sub, false, sub_color, pat_len, pat, lw_px, anno_scale, None, bg_color,
|
||||
doc, h, sub, false, sub_color, pat_len, pat, lw_px, anno_scale, None, bg_color, false,
|
||||
);
|
||||
if wires_out.is_empty() {
|
||||
return vec![];
|
||||
|
|
|
|||
Loading…
Reference in a new issue