aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-10-05 16:32:44 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-10-09 05:44:18 +0000
commit2c952761f2b113bf2c3f45abfe8119f243f38f88 (patch)
tree460a9c413e2dd041095fab423cf0bf50d9a00b7f
parentsixel: overwrite: use pixman to calculate new the sixel boundaries (diff)
sixel: unhook: do overwrite *after* linefeeding
This ensures the overwrite is done when the scrollback history is in the same state as when we then insert the new image.
-rw-r--r--sixel.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sixel.c b/sixel.c
index b7bcb65a..0b971a90 100644
--- a/sixel.c
+++ b/sixel.c
@@ -706,8 +706,8 @@ sixel_unhook(struct terminal *term)
.pos = (struct coord){start_col, cur_row},
};
- sixel_overwrite_by_rectangle(
- term, cursor->row, image.pos.col, image.rows, image.cols);
+ assert(image.rows < term->grid->num_rows);
+ assert(image.pos.row + image.rows - 1 < term->grid->num_rows);
LOG_DBG("generating %dx%d pixman image at %d-%d",
image.width, image.height,
@@ -723,6 +723,9 @@ sixel_unhook(struct terminal *term)
term_linefeed(term);
term_carriage_return(term);
+ _sixel_overwrite_by_rectangle(
+ term, image.pos.row, image.pos.col, image.rows, image.cols);
+
sixel_insert(term, image);
pixel_row_idx += height;