From 4b393610e21781e387cb1d1e98cbdea9203594ca Mon Sep 17 00:00:00 2001 From: Sander Schobers Date: Tue, 31 Dec 2019 11:22:18 +0100 Subject: [PATCH] Fixed bug in rendering of console. - All messages were rendered (outside bounds of the bitmap). Now only rendering (partially) visible messages. --- cmd/krampus19/console.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/krampus19/console.go b/cmd/krampus19/console.go index b59b9b2..a0132a2 100644 --- a/cmd/krampus19/console.go +++ b/cmd/krampus19/console.go @@ -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