text: round y offset of trailing newline

This commit tries to ensure that trailing newlines do not introduce more vertical space below
the text than is occupied by a typical text run within the text.

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
This commit is contained in:
Chris Waldon
2025-01-28 10:35:52 -05:00
parent adaace864d
commit 593c5fbf4a
+1 -1
View File
@@ -544,7 +544,7 @@ func (l *Shaper) NextGlyph() (_ Glyph, ok bool) {
// of a valid cursor position they can use for "after" such a newline,
// taking text alignment into account.
l.pararagraphStart.X = l.txt.alignment.Align(line.direction, 0, l.txt.alignWidth)
l.pararagraphStart.Y = glyph.Y + int32(line.lineHeight.Ceil())
l.pararagraphStart.Y = glyph.Y + int32(line.lineHeight.Round())
}
}
return glyph, true