forked from joejulian/gio
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:
+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(line.lineHeight.Ceil())
|
l.pararagraphStart.Y = glyph.Y + int32(line.lineHeight.Round())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return glyph, true
|
return glyph, true
|
||||||
|
|||||||
Reference in New Issue
Block a user