Check that cell is not wide right in render #362

This commit is contained in:
nick black 2020-04-12 07:01:35 -04:00 committed by Nick Black
parent b0aa6b9a7f
commit b0fc654444
3 changed files with 3 additions and 2 deletions

View File

@ -1250,6 +1250,7 @@ int ncplane_putc_yx(ncplane* n, int y, int x, const cell* c){
}
cell_obliterate(n, candidate);
cell_set_wide(candidate);
candidate->channels = c->channels;
}
}
n->x += cols;

View File

@ -279,7 +279,7 @@ paint(ncplane* p, cell* lastframe, struct crender* rvec,
const cell* vis = &p->fb[nfbcellidx(p, y, x)];
// if we never loaded any content into the cell (or obliterated it by
// writing in a zero), use the plane's base cell.
if(vis->gcluster == 0){
if(vis->gcluster == 0 && !cell_wide_right_p(vis)){
vis = &p->basecell;
}
// if we have no character in this cell, we continue to look for a

View File

@ -122,7 +122,7 @@ TEST_CASE("RenderTest") {
// should be nothing, having been stomped
egc = notcurses_at_yx(nc_, 0, 3, &c.attrword, &c.channels);
REQUIRE(egc);
CHECK(0 == strcmp(" ", egc));
CHECK(0 == strcmp("", egc));
free(egc);
cell_init(&c);