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:
parent
30999c944a
commit
4b393610e2
@ -63,7 +63,7 @@ func (c *console) Render(ctx *alui.Context, bounds geom.RectangleF32) {
|
|||||||
}
|
}
|
||||||
messageTop := size.Y - totalHeight - c.offset
|
messageTop := size.Y - totalHeight - c.offset
|
||||||
for _, m := range messages {
|
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)
|
ctx.Fonts.DrawFont(font, 0, messageTop, ctx.Palette.Text, m)
|
||||||
}
|
}
|
||||||
messageTop += lineHeight
|
messageTop += lineHeight
|
||||||
|
Loading…
Reference in New Issue
Block a user