From 27b05e6f1bd3c231f23164528220f79a4ba7fd91 Mon Sep 17 00:00:00 2001 From: nick black Date: Fri, 11 Jun 2021 19:43:31 -0400 Subject: [PATCH] sixel/kitty: remove references to stdplane #1615 --- src/lib/kitty.c | 7 +++---- src/lib/sixel.c | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/lib/kitty.c b/src/lib/kitty.c index 720911c2c..6f9470a76 100644 --- a/src/lib/kitty.c +++ b/src/lib/kitty.c @@ -582,16 +582,15 @@ int kitty_destroy(const notcurses* nc, const ncpile* p, FILE* out, sprixel* s){ return -1; } //fprintf(stderr, "FROM: %d/%d state: %d s->n: %p\n", s->movedfromy, s->movedfromx, s->invalidated, s->n); - const ncplane* stdn = notcurses_stdplane_const(nc); for(int yy = s->movedfromy ; yy < s->movedfromy + s->dimy && yy < p->dimy ; ++yy){ for(int xx = s->movedfromx ; xx < s->movedfromx + s->dimx && xx < p->dimx ; ++xx){ - const int ridx = (yy - stdn->absy) * p->dimx + (xx - stdn->absx); + const int ridx = (yy - nc->margin_t) * p->dimx + (xx - nc->margin_l); 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 - stdn->absy, - xx - s->movedfromx + s->n->absx - stdn->absx); + sprixcell_e state = sprixel_state(s, yy - s->movedfromy + s->n->absy - nc->margin_t, + xx - s->movedfromx + s->n->absx - nc->margin_l); if(state == SPRIXCELL_OPAQUE_KITTY){ r->s.damaged = 1; }else if(s->invalidated == SPRIXEL_MOVED){ diff --git a/src/lib/sixel.c b/src/lib/sixel.c index c3bd2deb9..38db72a52 100644 --- a/src/lib/sixel.c +++ b/src/lib/sixel.c @@ -809,16 +809,15 @@ int sixel_destroy(const notcurses* nc, const ncpile* p, FILE* out, sprixel* s){ (void)out; int starty = s->movedfromy; int startx = s->movedfromx; - const ncplane* stdn = notcurses_stdplane_const(nc); 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 - stdn->absy) * p->dimx + (xx - stdn->absx); + int ridx = (yy - nc->margin_t) * p->dimx + (xx - nc->margin_l); 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 - stdn->absy, - xx - s->movedfromx + s->n->absx - stdn->absx); + sprixcell_e state = sprixel_state(s, yy - s->movedfromy + s->n->absy - nc->margin_t, + xx - s->movedfromx + s->n->absx - nc->margin_l); if(state == SPRIXCELL_OPAQUE_SIXEL || state == SPRIXCELL_MIXED_SIXEL){ r->s.damaged = 1; }else if(s->invalidated == SPRIXEL_MOVED){