From 62be729c45ade3759ab0084808bbea491ca5c587 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Mon, 29 Jun 2020 22:01:02 +0200 Subject: scroll: destroy scrolled out sixels before scroll is applied The logic that breaks out of sixel loops does not work for rows that has already wrapped around. Thus, we need to destroy sixels that are about to be scrolled out *before* we actually scroll. Since this is the *only* time we destroy sixels (instead of overwriting it), rename the sixel functions. And, since they now do a very specific thing, they can be greatly simplified (and thus faster). --- terminal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index 667d91d1..2497dde5 100644 --- a/terminal.c +++ b/terminal.c @@ -1779,6 +1779,8 @@ term_scroll_partial(struct terminal *term, struct scroll_region region, int rows } } + sixel_scroll_up(term, rows); + bool view_follows = term->grid->view == term->grid->offset; term->grid->offset += rows; term->grid->offset &= term->grid->num_rows - 1; @@ -1800,7 +1802,6 @@ term_scroll_partial(struct terminal *term, struct scroll_region region, int rows for (int r = region.end - rows; r < region.end; r++) erase_line(term, grid_row_and_alloc(term->grid, r)); - sixel_delete_in_range(term, region.end - rows, region.end - 1); term_damage_scroll(term, DAMAGE_SCROLL, region, rows); term->grid->cur_row = grid_row(term->grid, term->grid->cursor.point.row); @@ -1841,6 +1842,8 @@ term_scroll_reverse_partial(struct terminal *term, } } + sixel_scroll_down(term, rows); + bool view_follows = term->grid->view == term->grid->offset; term->grid->offset -= rows; while (term->grid->offset < 0) @@ -1867,7 +1870,6 @@ term_scroll_reverse_partial(struct terminal *term, for (int r = region.start; r < region.start + rows; r++) erase_line(term, grid_row_and_alloc(term->grid, r)); - sixel_delete_in_range(term, region.start, region.start + rows - 1); term_damage_scroll(term, DAMAGE_SCROLL_REVERSE, region, rows); term->grid->cur_row = grid_row(term->grid, term->grid->cursor.point.row); -- cgit v1.3