Scrolling: cell_release() cleared rows #482

This commit is contained in:
nick black 2020-04-15 16:46:15 -04:00
parent a4e1d68786
commit f356af418b
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -456,6 +456,7 @@ int ncplane_resize_internal(ncplane* n, int keepy, int keepx, int keepleny,
int sourceline = keepy;
for(itery = 0 ; itery < ylen ; ++itery){
int copyoff = itery * xlen; // our target at any given time
// FIXME in memset()s here of existing text, don't we need cell_release()?
// if we have nothing copied to this line, zero it out in one go
if(itery < keepy || itery > keepy + keepleny - 1){
memset(fb + copyoff, 0, sizeof(*fb) * xlen);
@ -1219,6 +1220,9 @@ int ncplane_putc_yx(ncplane* n, int y, int x, const cell* c){
if(n->y == n->leny - 1){
n->logrow = (n->logrow + 1) % n->leny;
cell* row = n->fb + nfbcellidx(n, n->y, 0);
for(int clearx = 0 ; clearx < n->lenx ; ++clearx){
cell_release(n, &row[clearx]);
}
memset(row, 0, sizeof(*row) * n->lenx);
}else{
++n->y;