mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
term: re-calculate sixel images’ rows/cols values when cell size changes
This commit is contained in:
parent
bc75f4744c
commit
6cf86d67d9
1 changed files with 14 additions and 0 deletions
14
terminal.c
14
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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue