sixel/kitty: remove references to stdplane #1615

pull/1760/head
nick black 3 years ago committed by Nick Black
parent 007af7f9af
commit 27b05e6f1b

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

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

Loading…
Cancel
Save