aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-02-22 20:20:22 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-02-22 20:20:22 +0000
commit05ff2a8a15d5be6b996a16e84ffed5b8b43b7d49 (patch)
tree39cbdac01ea3d22381a1e20fce2300a6d16f20a5
parentsixel: add HLS color format support (diff)
sixel: don't ever shrink the image
-rw-r--r--sixel.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sixel.c b/sixel.c
index 7b1c8646..15aeca43 100644
--- a/sixel.c
+++ b/sixel.c
@@ -184,9 +184,15 @@ sixel_add(struct terminal *term, uint32_t color, uint8_t sixel)
if (term->sixel.pos.col >= term->sixel.image.width ||
term->sixel.pos.row * 6 + 5 >= term->sixel.image.height)
{
- resize(term,
- max(term->sixel.max_col, term->sixel.pos.col + 1),
- (term->sixel.pos.row + 1) * 6);
+ int width = max(
+ term->sixel.image.width,
+ max(term->sixel.max_col, term->sixel.pos.col + 1));
+
+ int height = max(
+ term->sixel.image.height,
+ (term->sixel.pos.row + 1) * 6))
+
+ resize(term, width, height);;
}
for (int i = 0; i < 6; i++, sixel >>= 1) {