From 20165ccbbed063b55582aa12c6887233e176d324 Mon Sep 17 00:00:00 2001 From: nick black Date: Fri, 11 Jun 2021 20:10:48 -0400 Subject: [PATCH] no need to reference margins from kitty code #1615 --- src/lib/kitty.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/kitty.c b/src/lib/kitty.c index 6f9470a76..e2d3a411d 100644 --- a/src/lib/kitty.c +++ b/src/lib/kitty.c @@ -577,20 +577,21 @@ int kitty_remove(int id, FILE* out){ // removes the kitty bitmap graphic identified by s->id, and damages those // cells which weren't SPRIXCEL_OPAQUE -int kitty_destroy(const notcurses* nc, const ncpile* p, FILE* out, sprixel* s){ +int kitty_destroy(const notcurses* nc __attribute__ ((unused)), + const ncpile* p, FILE* out, sprixel* s){ if(kitty_remove(s->id, out)){ return -1; } //fprintf(stderr, "FROM: %d/%d state: %d s->n: %p\n", s->movedfromy, s->movedfromx, s->invalidated, s->n); 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 - nc->margin_t) * p->dimx + (xx - nc->margin_l); + const 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_KITTY){ r->s.damaged = 1; }else if(s->invalidated == SPRIXEL_MOVED){