sprixel: damage only on sprite_wipe() failure

pull/2148/head
nick black 3 years ago
parent 1827a7d58d
commit 61ee8b8668
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -153,7 +153,7 @@ paint_sprixel(ncplane* p, struct crender* rvec, int starty, int startx,
if(crender->p || crender->s.bgblends){
// if sprite_wipe_cell() fails, we presumably do not have the
// ability to wipe, and must reprint the character
if(sprite_wipe(nc, p->sprite, y, x)){
if(sprite_wipe(nc, p->sprite, y, x) < 0){
//fprintf(stderr, "damaging due to wipe [%s] %d/%d\n", nccell_extended_gcluster(crender->p, &crender->c), absy, absx);
crender->s.damaged = 1;
}

@ -241,6 +241,11 @@ int sixel_wipe(sprixel* s, int ycell, int xcell){
change_p2(s->glyph.buf, SIXEL_P2_TRANS);
assert(NULL == s->n->tam[s->dimx * ycell + xcell].auxvector);
s->n->tam[s->dimx * ycell + xcell].auxvector = auxvec;
// FIXME this invalidation ought not be necessary, since we're simply
// wiping, and thus a glyph is going to be printed over whatever we've
// just destroyed. in alacritty, however, this isn't sufficient to knock
// out a graphic; we need repaint with the transparency.
// see https://github.com/dankamongmen/notcurses/issues/2142
int absx, absy;
ncplane_abs_yx(s->n, &absy, &absx);
sprixel_invalidate(s, absy, absx);

Loading…
Cancel
Save