mirror of https://github.com/fairyglade/ly.git
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:
parent
4ee2b3ecc7
commit
b131954a8c
10
src/draw.c
10
src/draw.c
|
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue