mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
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:
+1
-1
@@ -544,7 +544,7 @@ func (l *Shaper) NextGlyph() (_ Glyph, ok bool) {
|
|||||||
// of a valid cursor position they can use for "after" such a newline,
|
// of a valid cursor position they can use for "after" such a newline,
|
||||||
// taking text alignment into account.
|
// taking text alignment into account.
|
||||||
l.pararagraphStart.X = l.txt.alignment.Align(line.direction, 0, l.txt.alignWidth)
|
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
|
return glyph, true
|
||||||
|
|||||||
Reference in New Issue
Block a user