feat(text): MTEXT background fill / mask + text frame, editable in Properties

Render the MTEXT background (never drawn before — the flags were only shown
read-only in the panel) and make it editable.

- Text arm emits an opaque fill_tris rect behind the glyphs: flag 0x01 uses
  the entity background colour, 0x02 uses the canvas colour (a wipeout-style
  mask). Box = glyph bounds padded by (background_scale - 1) × text height.
- Text frame (flag 0x10) draws a closed rectangle in the text colour around
  the same box.
- Threaded `bg_color` into `tessellate()` (+ all callers and the
  MultiLeaderTess trait) so the mask can use the drawing-window colour.
- Properties: "Background mask" is a Off / Fill / Mask dropdown, "Background
  color" is its own colour picker (independent of the entity colour — new
  PropBgColor* messages; picking a colour switches to Fill mode), and "Text
  frame" is a checkbox toggle. Edits re-tessellate so the change shows live.

Renders via the face3d fill path, so the fill shows with FILLMODE on (same as
MLEADER background fill); the frame is a stroke and always shows.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-07-07 17:41:16 +03:00
commit cd7306f530
10 changed files with 223 additions and 14 deletions

View file

@ -196,6 +196,7 @@ pub(crate) fn tessellate_entity(
1.5,
1.0,
world_per_pixel,
bg_color,
);
let ab = entity_aabb(e);
for w in &mut wires {
@ -343,6 +344,7 @@ pub(crate) fn tessellate_entity(
line_weight_px,
anno_scale,
world_per_pixel,
bg_color,
);
for w in &mut wires {
w.aci = aci;
@ -579,6 +581,7 @@ pub(crate) fn tessellate_entity(
sub_line_weight_px,
anno_scale,
world_per_pixel,
bg_color,
);
for w in &mut wires {
w.name = h.value().to_string();
@ -753,6 +756,7 @@ pub(crate) fn tessellate_entity(
line_weight_px,
anno_scale,
world_per_pixel,
bg_color,
);
for b in &mut bases {
b.aci = aci;