sync sixel_draw/kitty_redraw #2189

pull/2197/head
nick black 3 years ago
parent e983c83d4e
commit 0bf192f4c1
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -711,15 +711,13 @@ sprite_scrub(const notcurses* n, const ncpile* p, sprixel* s){
// returns -1 on error, or the number of bytes written.
static inline int
sprite_draw(const tinfo* ti, const ncpile* p, sprixel* s, fbuf* f,
int y, int x){
int yoff, int xoff){
if(!ti->pixel_draw){
return 0;
}
int offy, offx;
ncplane_abs_yx(s->n, &offy, &offx);
//sprixel_debug(s, stderr);
logdebug("sprixel %u state %d\n", s->id, s->invalidated);
return ti->pixel_draw(ti, p, s, f, y + offy, x + offx);
return ti->pixel_draw(ti, p, s, f, yoff, xoff);
}
// precondition: s->invalidated is SPRIXEL_MOVED or SPRIXEL_INVALIDATED

@ -1002,7 +1002,7 @@ int sixel_scrub(const ncpile* p, sprixel* s){
// returns the number of bytes written
int sixel_draw(const tinfo* ti, const ncpile* p, sprixel* s, fbuf* f,
int y, int x){
int yoff, int xoff){
(void)ti;
// if we've wiped or rebuilt any cells, effect those changes now, or else
// we'll get flicker when we move to the new location.
@ -1013,7 +1013,9 @@ int sixel_draw(const tinfo* ti, const ncpile* p, sprixel* s, fbuf* f,
s->wipes_outstanding = false;
}
if(p){
if(goto_location(p->nc, f, y, x)){
const int targy = s->n->absy + yoff;
const int targx = s->n->absx + xoff;
if(goto_location(p->nc, f, targy, targx)){
return -1;
}
if(s->invalidated == SPRIXEL_MOVED){

Loading…
Cancel
Save