feat(text): SDF for synthesized-table cell text + guard table pick box

An in-app-created table (no baked *T### block) synthesised its cell text via
layout_mtext as stroke polylines — the last text path still rendering strokes
while SDF is the default (imported/baked tables already render SDF via the
recursive Text arm).

- tessellate_table: when SDF is on, build each cell's glyph quads from the
  run-carrying layout and collect them into one text-carrying wire (per-vertex
  cell colour, glyph-bounds AABB); the stroke/fill accumulation is the SDF-off
  fallback. Mirrors the MLEADER SDF branch.
- tess.rs synthesized-table path: guard the whole-table AABB clobber on
  (!points.is_empty() || !fill_tris.is_empty()) — matching the dim / mleader /
  baked-block paths — so the empty SDF-text wire keeps its tight glyph-box AABB
  and the pick box hugs the text instead of the whole table. Found by the
  adversarial review pass.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-07-07 18:37:17 +03:00
1 parent d9a2c8245c
commit 67ce45d40b
2 files changed
+75 -20

No files matched your search

+6 -1
View File
@@ -437,7 +437,12 @@ pub(crate) fn tessellate_entity(
let aabb = entity_aabb(e);
for w in &mut wires {
w.aci = aci;
w.aabb = aabb;
// Empty SDF-text cells keep their tight glyph-box AABB; only
// stroke/fill wires take the whole-table box as a broad-phase
// pick hint (matches the dim / mleader / baked-block paths).
if !w.points.is_empty() || !w.fill_tris.is_empty() {
w.aabb = aabb;
}
}
return wires;
}