mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-02 07:15:31 -04:00
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).
This commit is contained in:
parent
a136987678
commit
62be729c45
4 changed files with 64 additions and 142 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue