mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-10 05:33:51 -04:00
multi-cursor: refactor: add function for dirtying/damaging all multi-cursors
This commit is contained in:
parent
4f89c461b1
commit
265c93c4c4
3 changed files with 32 additions and 47 deletions
23
terminal.c
23
terminal.c
|
|
@ -2567,6 +2567,29 @@ term_damage_cursor(struct terminal *term)
|
|||
term->grid->cur_row->dirty = true;
|
||||
}
|
||||
|
||||
void
|
||||
term_damage_all_multi_cursors(struct terminal *term)
|
||||
{
|
||||
if (likely(term->multi_cursor.shapes == NULL))
|
||||
return;
|
||||
|
||||
int rect_count = 0;
|
||||
const pixman_box32_t *boxes =
|
||||
pixman_region32_rectangles(&term->multi_cursor.active, &rect_count);
|
||||
|
||||
for (const pixman_box32_t *box = boxes; box < &boxes[rect_count]; box++) {
|
||||
for (int r = box->y1; r < box->y2; r++) {
|
||||
struct row *row = grid_row(term->grid, r);
|
||||
xassert(row != NULL);
|
||||
|
||||
row->dirty = true;
|
||||
|
||||
for (struct cell *c = &row->cells[box->x1]; c < &row->cells[box->x2]; c++)
|
||||
c->attrs.clean = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
term_damage_margins(struct terminal *term)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue