mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-31 07:11:09 -04:00
sixel: improve handling of images when reflowing the grids
Update the sixels' 'row' attribute when re-flowing a grid, to ensure it is rendered at the correct place. This should work in most cases, but will break when the cell size has changed (e.g. font size increase/decrease, or a DPI change). This patch also moves the sixel image list from the terminal struct into the grid struct. The sixels are per-grid after all.
This commit is contained in:
parent
62a5805d4b
commit
d482bf0a30
7 changed files with 69 additions and 42 deletions
22
terminal.h
22
terminal.h
|
|
@ -86,6 +86,15 @@ struct row {
|
|||
bool linebreak;
|
||||
};
|
||||
|
||||
struct sixel {
|
||||
void *data;
|
||||
pixman_image_t *pix;
|
||||
int width;
|
||||
int height;
|
||||
int rows;
|
||||
struct coord pos;
|
||||
};
|
||||
|
||||
struct grid {
|
||||
int num_rows;
|
||||
int num_cols;
|
||||
|
|
@ -97,6 +106,7 @@ struct grid {
|
|||
|
||||
tll(struct damage) damage;
|
||||
tll(struct damage) scroll_damage;
|
||||
tll(struct sixel) sixel_images;
|
||||
};
|
||||
|
||||
struct vt_subparams {
|
||||
|
|
@ -175,16 +185,6 @@ struct ptmx_buffer {
|
|||
size_t idx;
|
||||
};
|
||||
|
||||
struct sixel {
|
||||
void *data;
|
||||
pixman_image_t *pix;
|
||||
int width;
|
||||
int height;
|
||||
int rows;
|
||||
const struct grid *grid;
|
||||
struct coord pos;
|
||||
};
|
||||
|
||||
enum term_surface {
|
||||
TERM_SURF_NONE,
|
||||
TERM_SURF_GRID,
|
||||
|
|
@ -417,8 +417,6 @@ struct terminal {
|
|||
unsigned max_height; /* Maximum image height, in pixels */
|
||||
} sixel;
|
||||
|
||||
tll(struct sixel) sixel_images;
|
||||
|
||||
bool hold_at_exit;
|
||||
bool is_shutting_down;
|
||||
void (*shutdown_cb)(void *data, int exit_code);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue