From d482bf0a304b8224499bf9de9e0781518106ec7c Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Fri, 13 Mar 2020 18:44:23 +0100 Subject: 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. --- terminal.h | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'terminal.h') diff --git a/terminal.h b/terminal.h index 92082d8c..90379ba1 100644 --- a/terminal.h +++ b/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); -- cgit v1.3