aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2024-02-27 00:27:54 +0100
committerPřemysl Eric Janouch <p@janouch.name>2024-02-27 00:27:54 +0100
commit969a4cfc3ea1c4d7c0327907385fc64906ed5d4c (patch)
treea034250a2d5845ed9c7c34a1cd22761e7c90f09f
parentad5b2fb8cd4915de9c6d97c362839de02d4970a6 (diff)
downloadliberty-969a4cfc3ea1c4d7c0327907385fc64906ed5d4c.tar.gz
liberty-969a4cfc3ea1c4d7c0327907385fc64906ed5d4c.tar.xz
liberty-969a4cfc3ea1c4d7c0327907385fc64906ed5d4c.zip
liberty-xui: clip terminal drawing
-rw-r--r--liberty-xui.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/liberty-xui.c b/liberty-xui.c
index 2096a61..e5d0246 100644
--- a/liberty-xui.c
+++ b/liberty-xui.c
@@ -728,9 +728,12 @@ tui_flush_buffer (struct widget *self, struct row_buffer *buf)
{
move (self->y, self->x);
- int space = MIN (self->width, g_xui.width - self->x);
- row_buffer_align (buf, space, self->attrs);
- row_buffer_flush (buf);
+ if (self->y >= 0 && self->y < g_xui.height)
+ {
+ int space = MIN (self->width, g_xui.width - self->x);
+ row_buffer_align (buf, space, self->attrs);
+ row_buffer_flush (buf);
+ }
row_buffer_free (buf);
}