mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
83202263b9
This commit reverts the work of several previous attempts to resolve truncation-related rune accounting problems and adopts a simpler approach. Instead of taking a special codepath when shaping only a newline, we shape the empty string to get its line metrics. Instead of modifying the final glyph conditionally to account for runes we never actually shaped, we track that count on the document type and handle it withing the NextGlyph method. These changes result in much simpler code, and resolve a real bug. We were accidentally corrupting cached paragraphs when doing the truncation post-processing in Shaper.layoutText. The modification made to the final glyph there actually did modify the cached copy, which would then be reused when that string was shaped again (even if there were a different number of truncated runes after it). This changeset ensures that the cached copy of a paragraph is never modified. Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>