mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-01 07:15:32 -04:00
sixel: add sixel_cell_size_changed()
This function should be called *after* the cell dimensions have changed, but *before* resizing/reflowing the grids.
This commit is contained in:
parent
5e5036bec9
commit
74c7373efc
2 changed files with 25 additions and 0 deletions
24
sixel.c
24
sixel.c
|
|
@ -484,6 +484,30 @@ sixel_overwrite_at_cursor(struct terminal *term, int width)
|
||||||
term, term->grid->cursor.point.row, term->grid->cursor.point.col, width);
|
term, term->grid->cursor.point.row, term->grid->cursor.point.col, width);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
sixel_cell_size_changed(struct terminal *term)
|
||||||
|
{
|
||||||
|
struct grid *g = term->grid;
|
||||||
|
|
||||||
|
term->grid = &term->normal;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
verify_sixels(term);
|
||||||
|
|
||||||
|
term->grid = &term->alt;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
verify_sixels(term);
|
||||||
|
|
||||||
|
term->grid = g;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
sixel_unhook(struct terminal *term)
|
sixel_unhook(struct terminal *term)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
1
sixel.h
1
sixel.h
|
|
@ -16,6 +16,7 @@ void sixel_destroy_all(struct terminal *term);
|
||||||
void sixel_scroll_up(struct terminal *term, int rows);
|
void sixel_scroll_up(struct terminal *term, int rows);
|
||||||
void sixel_scroll_down(struct terminal *term, int rows);
|
void sixel_scroll_down(struct terminal *term, int rows);
|
||||||
|
|
||||||
|
void sixel_cell_size_changed(struct terminal *term);
|
||||||
/*
|
/*
|
||||||
* Remove sixel data from the specified location. Used when printing
|
* Remove sixel data from the specified location. Used when printing
|
||||||
* or erasing characters, and when emitting new sixel images, to
|
* or erasing characters, and when emitting new sixel images, to
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue