From 969a4cfc3ea1c4d7c0327907385fc64906ed5d4c Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Tue, 27 Feb 2024 00:27:54 +0100 Subject: liberty-xui: clip terminal drawing --- liberty-xui.c | 9 ++++++--- 1 file 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); } -- cgit v1.2.3-70-g09d2