ncplane_erase: fix bug in basecell preservation

pull/592/head
nick black 4 years ago
parent 3eb99b2447
commit 95ba340fba
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -544,7 +544,7 @@ int ncplane_mergedown(struct ncplane* restrict src, struct ncplane* restrict dst
// Erase every cell in the ncplane, resetting all attributes to normal, all
// colors to the default color, and all cells to undrawn. All cells associated
// with this ncplane are invalidated, and must not be used after the call,
// excluding the base cell.
// excluding the base cell. The cursor is homed.
void ncplane_erase(struct ncplane* n);
```

@ -196,6 +196,9 @@ expressed relative to the standard plane, and returns coordinates relative to
of the rendering region. Only those cells where **src** intersects with **dst**
might see changes. It is an error to merge a plane onto itself.
**ncplane_erase** zeroes out every cell of the plane, dumps the egcpool, and
homes the cursor. The base cell is preserved.
## Scrolling
All planes, including the standard plane, are created with scrolling disabled.

@ -1629,7 +1629,7 @@ API int ncplane_mergedown(struct ncplane* RESTRICT src, struct ncplane* RESTRICT
// Erase every cell in the ncplane, resetting all attributes to normal, all
// colors to the default color, and all cells to undrawn. All cells associated
// with this ncplane is invalidated, and must not be used after the call,
// excluding the base cell.
// *excluding* the base cell. The cursor is homed.
API void ncplane_erase(struct ncplane* n);
#define NCPALETTESIZE 256

@ -1773,8 +1773,10 @@ void ncplane_erase(ncplane* n){
memset(n->fb, 0, sizeof(*n->fb) * n->lenx * n->leny);
egcpool_dump(&n->pool);
egcpool_init(&n->pool);
cell_init(&n->basecell);
cell_load(n, &n->basecell, egc);
free(egc);
n->y = n->x = 0;
}
void notcurses_cursor_enable(notcurses* nc){

Loading…
Cancel
Save