mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-05 07:15:30 -04:00
sixel: add sixel_reflow_grid()
This function reflows all sixels in the specified grid. The pre-existing sixel_reflow() function is a shortcut for sixel_reflow_grid(term, &term->normal) sixel_reflow_grid(term, &term->alt);
This commit is contained in:
parent
b52262da8e
commit
f70c34c5a8
2 changed files with 79 additions and 71 deletions
20
sixel.c
20
sixel.c
|
|
@ -838,13 +838,10 @@ sixel_cell_size_changed(struct terminal *term)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
sixel_reflow(struct terminal *term)
|
sixel_reflow_grid(struct terminal *term, struct grid *grid)
|
||||||
{
|
{
|
||||||
struct grid *g = term->grid;
|
/* Meh - the sixel functions we call use term->grid... */
|
||||||
|
struct grid *active_grid = term->grid;
|
||||||
for (size_t i = 0; i < 2; i++) {
|
|
||||||
struct grid *grid = i == 0 ? &term->normal : &term->alt;
|
|
||||||
|
|
||||||
term->grid = grid;
|
term->grid = grid;
|
||||||
|
|
||||||
/* Need the “real” list to be empty from the beginning */
|
/* Need the “real” list to be empty from the beginning */
|
||||||
|
|
@ -914,9 +911,16 @@ sixel_reflow(struct terminal *term)
|
||||||
}
|
}
|
||||||
|
|
||||||
tll_free(copy);
|
tll_free(copy);
|
||||||
}
|
term->grid = active_grid;
|
||||||
|
}
|
||||||
|
|
||||||
term->grid = g;
|
void
|
||||||
|
sixel_reflow(struct terminal *term)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < 2; i++) {
|
||||||
|
struct grid *grid = i == 0 ? &term->normal : &term->alt;
|
||||||
|
sixel_reflow_grid(term, grid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
4
sixel.h
4
sixel.h
|
|
@ -19,6 +19,10 @@ 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);
|
void sixel_cell_size_changed(struct terminal *term);
|
||||||
|
|
||||||
|
void sixel_reflow_grid(struct terminal *term, struct grid *grid);
|
||||||
|
|
||||||
|
/* Shortcut for sixel_reflow_grid(normal) + sixel_reflow_grid(alt) */
|
||||||
void sixel_reflow(struct terminal *term);
|
void sixel_reflow(struct terminal *term);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue