Fixed bug in rendering of console.

- All messages were rendered (outside bounds of the bitmap). Now only rendering (partially) visible messages.
This commit is contained in:
Sander Schobers 2019-12-31 11:22:18 +01:00
parent 30999c944a
commit 4b393610e2

View File

@ -63,7 +63,7 @@ func (c *console) Render(ctx *alui.Context, bounds geom.RectangleF32) {
}
messageTop := size.Y - totalHeight - c.offset
for _, m := range messages {
if messageTop <= size.Y || (messageTop+lineHeight) >= 0 {
if messageTop <= size.Y && (messageTop+lineHeight) >= 0 {
ctx.Fonts.DrawFont(font, 0, messageTop, ctx.Palette.Text, m)
}
messageTop += lineHeight