From 39335bc210ec091a13c6574d00b0c3257a550987 Mon Sep 17 00:00:00 2001 From: nick black Date: Wed, 14 Apr 2021 00:48:16 -0400 Subject: [PATCH] [sixel_wipe] set SIXEL_P2_TRANS #1527 --- src/lib/sixel.c | 11 +++++++++++ src/lib/terminfo.c | 1 + 2 files changed, 12 insertions(+) diff --git a/src/lib/sixel.c b/src/lib/sixel.c index c8c6e1b28..1b1090c89 100644 --- a/src/lib/sixel.c +++ b/src/lib/sixel.c @@ -540,3 +540,14 @@ int sprite_sixel_init(int fd){ // the upper left corner of the screen). return tty_emit("\e[?80;8452h", fd); } + +// we return -1 because we're not doing a proper wipe -- that's not possible +// using sixel. we just mark it as partially transparent, so that if it's +// redrawn, it's redrawn using P2=1. +int sixel_wipe(const notcurses* nc, sprixel* s, int ycell, int xcell){ + (void)nc; + (void)ycell; + (void)xcell; + change_p2(s->glyph, SIXEL_P2_TRANS); + return -1; +} diff --git a/src/lib/terminfo.c b/src/lib/terminfo.c index 2471fe39d..28dd444a8 100644 --- a/src/lib/terminfo.c +++ b/src/lib/terminfo.c @@ -338,6 +338,7 @@ setup_sixel(tinfo* ti){ ti->sixel_maxx = 4096; // whee! ti->sixel_maxy = 4096; ti->pixel_destroy = sixel_delete; + ti->pixel_cell_wipe = sixel_wipe; } // query for Sixel support