diff --git a/src/lib/sixel.c b/src/lib/sixel.c index 38db72a52..df1ca6a93 100644 --- a/src/lib/sixel.c +++ b/src/lib/sixel.c @@ -811,13 +811,13 @@ int sixel_destroy(const notcurses* nc, const ncpile* p, FILE* out, sprixel* s){ int startx = s->movedfromx; for(int yy = starty ; yy < starty + s->dimy && yy < p->dimy ; ++yy){ for(int xx = startx ; xx < startx + s->dimx && xx < p->dimx ; ++xx){ - int ridx = (yy - nc->margin_t) * p->dimx + (xx - nc->margin_l); + int ridx = yy * p->dimx + xx; struct crender *r = &p->crender[ridx]; if(!r->sprixel){ if(s->n){ //fprintf(stderr, "CHECKING %d/%d\n", yy - s->movedfromy, xx - s->movedfromx); - sprixcell_e state = sprixel_state(s, yy - s->movedfromy + s->n->absy - nc->margin_t, - xx - s->movedfromx + s->n->absx - nc->margin_l); + sprixcell_e state = sprixel_state(s, yy - s->movedfromy + s->n->absy, + xx - s->movedfromx + s->n->absx); if(state == SPRIXCELL_OPAQUE_SIXEL || state == SPRIXCELL_MIXED_SIXEL){ r->s.damaged = 1; }else if(s->invalidated == SPRIXEL_MOVED){