ncvisual_render_pixels: hide any old sprixels

This commit is contained in:
nick black 2021-04-04 04:17:34 -04:00
parent 2f47d9adef
commit 0dbd3cf830
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -605,6 +605,12 @@ ncplane* ncvisual_render_pixels(notcurses* nc, ncvisual* ncv, const struct blits
if(ncv->spx == NULL || n->sprite == NULL){ if(ncv->spx == NULL || n->sprite == NULL){
int cols = dispcols / bargs.u.pixel.celldimx + !!(dispcols % bargs.u.pixel.celldimx); int cols = dispcols / bargs.u.pixel.celldimx + !!(dispcols % bargs.u.pixel.celldimx);
int rows = disprows / bargs.u.pixel.celldimy + !!(disprows % bargs.u.pixel.celldimy); int rows = disprows / bargs.u.pixel.celldimy + !!(disprows % bargs.u.pixel.celldimy);
if(ncv->spx){
sprixel_hide(ncv->spx);
}
if(n->sprite){
sprixel_hide(n->sprite);
}
if((ncv->spx = sprixel_alloc(n, ncv, rows, cols)) == NULL){ if((ncv->spx = sprixel_alloc(n, ncv, rows, cols)) == NULL){
goto err; goto err;
} }