aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-03-10 19:31:21 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-03-11 16:33:01 +0000
commit6f6bcbc1bc5a9378bd16bd300ec89ddb35d9f863 (patch)
tree840ae765ad57daecdfd864b97d5f675062f8f57d
parentgenerate-alt-random: sixel: emit at least 4 color bands (diff)
sixel: decgra: set max-non-empty-row-no when resizing the image
This ensures we don’t trim off bottom rows in unhook(). This could happen either because the application used “Set Raster Attributes” to configure an image size larger than the sixels later emitted. Or, the last sixel row contains empty pixel rows. In either case, the size set with “Set Raster Attributes” defines the *minimum* image size; the image may still end up being larger.
-rw-r--r--sixel.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sixel.c b/sixel.c
index 2c440a6d..776750a2 100644
--- a/sixel.c
+++ b/sixel.c
@@ -1145,6 +1145,7 @@ decgra(struct terminal *term, uint8_t c)
ph <= term->sixel.max_height && pv <= term->sixel.max_width)
{
resize(term, ph, pv);
+ term->sixel.max_non_empty_row_no = pv - 1;
}
term->sixel.state = SIXEL_DECSIXEL;