From 6cf86d67d9fafe6ac4efc2626e2f0174c938f35f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 3 Oct 2020 22:41:20 +0200 Subject: [PATCH] =?UTF-8?q?term:=20re-calculate=20sixel=20images=E2=80=99?= =?UTF-8?q?=20rows/cols=20values=20when=20cell=20size=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- terminal.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/terminal.c b/terminal.c index 077d15f0..a286161f 100644 --- a/terminal.c +++ b/terminal.c @@ -1526,6 +1526,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; }