text: respect line height when layout the last empty line.

Text Shaper set the last empty line height to ascent+decent
of the paragraph break glyph which causes the last visual empty
line to have a smaller line height. This commit tries to fix it
by setting the line height using the line height from the last line.

References: https://todo.sr.ht/~eliasnaur/gio/629
Signed-off-by: zjzhang <zhangzj33@gmail.com>
This commit is contained in:
zjzhang
2025-01-25 22:04:47 +08:00
committed by Chris Waldon
parent f200f0e9a3
commit adaace864d
+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((glyph.Ascent + glyph.Descent).Ceil())
l.pararagraphStart.Y = glyph.Y + int32(line.lineHeight.Ceil())
}
}
return glyph, true