account for margins in sixel/kitty_destroy() #1588

pull/1640/head
nick black 3 years ago
parent dc9db79100
commit 19006b4988
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -571,12 +571,13 @@ 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){
struct crender *r = &p->crender[yy * p->dimx + xx];
const int ridx = (yy - stdn->absy) * p->dimx + (xx - stdn->absx);
struct crender *r = &p->crender[ridx];
if(!r->sprixel){
if(s->n){
const ncplane* stdn = notcurses_stdplane_const(nc);
//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);

@ -693,9 +693,11 @@ 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){
struct crender *r = &p->crender[yy * p->dimx + xx];
int ridx = (yy - stdn->absy) * p->dimx + (xx - stdn->absx);
struct crender *r = &p->crender[ridx];
// FIXME this probably overdoes it -- look at kitty_destroy()
if(!r->sprixel){
r->s.damaged = 1;

Loading…
Cancel
Save