mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
render: multi-cursor: translate view-based row number to absolute
Otherwise we'll lookup the wrong multi-cursor shape.
This commit is contained in:
parent
7dbccefeea
commit
cc02902db0
1 changed files with 7 additions and 1 deletions
8
render.c
8
render.c
|
|
@ -1348,8 +1348,14 @@ render_row(struct terminal *term, pixman_image_t *pix,
|
|||
cursor_col == col, MULTI_CURSOR_SHAPE_NONE);
|
||||
}
|
||||
} else {
|
||||
/* Translate view-relative row number to absolute numbers */
|
||||
int multi_cursor_row = row_no;
|
||||
multi_cursor_row += term->grid->view;
|
||||
multi_cursor_row -= term->grid->offset;
|
||||
multi_cursor_row &= term->grid->num_rows - 1;
|
||||
|
||||
enum multi_cursor_shape *extra_cursors =
|
||||
&term->multi_cursor.shapes[row_no * term->cols + term->cols - 1];
|
||||
&term->multi_cursor.shapes[multi_cursor_row * term->cols + term->cols - 1];
|
||||
|
||||
for (int col = term->cols - 1; col >= 0; col--, extra_cursors--) {
|
||||
render_cell(term, pix, damage, row, row_no, col,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue