aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-10-03 20:41:20 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-10-11 17:25:20 +0000
commit9cccc76520a3eac3957d22bf9becd68d378521cf (patch)
treec59dc0a0f28892244686193cda764604bf1f7b48
parentsixel: fix sheared image when image crosses scrollback wrap-around (diff)
term: re-calculate sixel images’ rows/cols values when cell size changes
-rw-r--r--terminal.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/terminal.c b/terminal.c
index 0840a45c..a34ecb1a 100644
--- a/terminal.c
+++ b/terminal.c
@@ -1524,6 +1524,20 @@ term_font_size_adjust(struct terminal *term, double amount)
* So we delete them.
*/
sixel_destroy_all(term);
+ } else if (term->cell_width != old_cell_width ||
+ term->cell_height != old_cell_height)
+ {
+ tll_foreach(term->normal.sixel_images, it) {
+ struct sixel *six = &it->item;
+ six->rows = (six->height + term->cell_height - 1) / term->cell_height;
+ six->cols = (six->width + term->cell_width - 1) / term->cell_width;
+ }
+
+ tll_foreach(term->alt.sixel_images, it) {
+ struct sixel *six = &it->item;
+ six->rows = (six->height + term->cell_height - 1) / term->cell_height;
+ six->cols = (six->width + term->cell_width - 1) / term->cell_width;
+ }
}
return true;
}