From b131954a8cc3ca52ad9f395fe589e239991157ee Mon Sep 17 00:00:00 2001 From: wr7 Date: Fri, 22 Dec 2023 09:40:40 -0600 Subject: [PATCH] Fix matrix animation crash when terminal height is 3 If the terminal height is 3 or less, don't render the matrix animation --- src/draw.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/draw.c b/src/draw.c index 0679244..363d84e 100644 --- a/src/draw.c +++ b/src/draw.c @@ -709,6 +709,11 @@ static void matrix_init(struct term_buf* buf) dgn_throw(DGN_ALLOC); } + if(buf->height <= 3) + { + return; + } + // Initialize grid for (int i = 0; i <= buf->height; ++i) { @@ -840,6 +845,11 @@ static void matrix(struct term_buf* buf) return; } + if(buf->height <= 3) + { + return; + } + count += 1; if (count > frame_delay) {