no need to track margins in sixel code #1615

pull/1760/head
nick black 3 years ago committed by Nick Black
parent 20165ccbbe
commit f822510c3f

@ -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){

Loading…
Cancel
Save