diff --git a/src/lib/kitty.c b/src/lib/kitty.c index a67ccbbce..cd76f6b7a 100644 --- a/src/lib/kitty.c +++ b/src/lib/kitty.c @@ -533,7 +533,16 @@ int kitty_wipe(sprixel* s, int ycell, int xcell){ int kitty_commit(fbuf* f, sprixel* s, unsigned noscroll){ loginfo("Committing Kitty graphic id %u\n", s->id); - fbuf_printf(f, "\e_Ga=p,i=%u,p=1,q=2%s\e\\", s->id, noscroll ? ",C=1" : ""); + int i; + if(s->pxoffx || s->pxoffy){ + i = fbuf_printf(f, "\e_Ga=p,i=%u,p=1,X=%u,Y=%u%s\e\\", s->id, + s->pxoffx, s->pxoffy, noscroll ? ",C=1" : ""); + }else{ + i = fbuf_printf(f, "\e_Ga=p,i=%u,p=1,q=2%s\e\\", s->id, noscroll ? ",C=1" : ""); + } + if(i < 0){ + return -1; + } s->invalidated = SPRIXEL_QUIESCENT; return 0; } @@ -1074,6 +1083,8 @@ kitty_blit_core(ncplane* n, int linesize, const void* data, int leny, int lenx, n->tam, SPRIXEL_UNSEEN) < 0){ goto error; } + s->pxoffx = pxoffx; + s->pxoffy = pxoffy; return 1; error: diff --git a/src/lib/sprite.h b/src/lib/sprite.h index 1a604af7d..598e7d999 100644 --- a/src/lib/sprite.h +++ b/src/lib/sprite.h @@ -150,6 +150,7 @@ typedef struct sprixel { int movedfromx; // so that we can damage old cells when redrawn // only used for kitty-based sprixels int parse_start; // where to start parsing for cell wipes + int pxoffy, pxoffx; // X and Y parameters to display command // only used for sixel-based sprixels unsigned char* needs_refresh; // one per cell, whether new frame needs damage struct sixelmap* smap; // copy of palette indices + transparency bits