Belén Albeza 5aac5ab9ba
🐛 Fix not rendering & computing into layout trailing white spaces (#13127)
* 🐛 Keep trailing spaces in WASM text bounds

Skia's longest_line() and line widths leave out the spaces at the end
of a line, so auto-width texts lost their trailing spaces in the
selrect, and the tight text bounds cut them off too. Fonts that draw
a glyph for spaces, like Zilla Slab Highlight, showed the gap.

- Measure auto-width text with max_intrinsic_width(), which keeps
  trailing spaces.
- Extend each line's tight bounds with the rects of its whole range,
  trailing spaces included.

Closes #12998

AI-assisted-by: claude-opus-5-5

* 🐛 Paint trailing spaces in WASM text

Skia lays out the spaces at the end of a line but never paints them.
Fonts that draw a glyph for spaces, like Zilla Slab Highlight, lost
those glyphs on the WebGL renderer.

- End each paragraph that ends in whitespace with a zero-size
  placeholder. The spaces are no longer trailing, so Skia measures and
  paints them with the right glyphs and paints.
- Add it to the fill and stroke builders alike, so their layouts match.
- Leave it out when it would wrap onto a line of its own in a fixed or
  auto-height box, which would add an empty line. A probe layout per
  paragraph decides this, cached per content version and box width.

Closes #12998

AI-assisted-by: claude-opus-5-5
2026-11-24 12:58:25 +01:00
..
2026-06-02 09:38:52 +02:00
2026-06-29 10:34:44 +02:00
2026-06-02 09:38:52 +02:00
2026-06-02 09:38:52 +02:00
2026-07-03 08:37:22 +02:00