mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-18 03:25:55 +00:00
sync sixel_draw/kitty_redraw #2189
This commit is contained in:
parent
e983c83d4e
commit
0bf192f4c1
@ -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…
Reference in New Issue
Block a user