Fix matrix animation crash when terminal height is 3

If the terminal height is 3 or less, don't render the
matrix animation
This commit is contained in:
wr7 2023-12-22 09:40:40 -06:00
parent 4ee2b3ecc7
commit b131954a8c
1 changed files with 10 additions and 0 deletions

View File

@ -709,6 +709,11 @@ static void matrix_init(struct term_buf* buf)
dgn_throw(DGN_ALLOC); dgn_throw(DGN_ALLOC);
} }
if(buf->height <= 3)
{
return;
}
// Initialize grid // Initialize grid
for (int i = 0; i <= buf->height; ++i) for (int i = 0; i <= buf->height; ++i)
{ {
@ -840,6 +845,11 @@ static void matrix(struct term_buf* buf)
return; return;
} }
if(buf->height <= 3)
{
return;
}
count += 1; count += 1;
if (count > frame_delay) if (count > frame_delay)
{ {