|
|
|
@ -525,14 +525,12 @@ int sixel_delete(const notcurses* nc, const ncpile* p, FILE* out, sprixel* s){
|
|
|
|
|
int sixel_draw(const notcurses* n, const ncpile* p, sprixel* s, FILE* out){
|
|
|
|
|
(void)n;
|
|
|
|
|
if(s->invalidated == SPRIXEL_MOVED){
|
|
|
|
|
for(int yy = s->movedfromy ; yy < s->movedfromy + s->dimy ; ++yy){
|
|
|
|
|
for(int xx = s->movedfromx ; xx < s->movedfromx + s->dimx ; ++xx){
|
|
|
|
|
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){
|
|
|
|
|
//fprintf(stderr, "DAMAGING DUE TO MOVE: %d/%d (%d)\n", yy, xx, yy * p->dimx + xx);
|
|
|
|
|
if(xx < p->dimx && yy < p->dimy){
|
|
|
|
|
p->crender[yy * p->dimx + xx].s.damaged = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
s->invalidated = SPRIXEL_INVALIDATED;
|
|
|
|
|
}else{
|
|
|
|
|
if(fwrite(s->glyph, s->glyphlen, 1, out) != 1){
|
|
|
|
|