mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-29 07:58:01 -04:00
render: multi-cell: decrement 'extra-cursor' pointer instead of indexing
This commit is contained in:
parent
64f52190ed
commit
dcabe14392
1 changed files with 11 additions and 7 deletions
18
render.c
18
render.c
|
|
@ -1272,15 +1272,19 @@ render_row(struct terminal *term, pixman_image_t *pix,
|
||||||
pixman_region32_t *damage, struct row *row,
|
pixman_region32_t *damage, struct row *row,
|
||||||
int row_no, int cursor_col)
|
int row_no, int cursor_col)
|
||||||
{
|
{
|
||||||
if (likely(pixman_region32_empty(&term->multi_cursor.active))) {
|
if (likely(term->multi_cursor.shapes == NULL)) {
|
||||||
for (int col = term->cols - 1; col >= 0; col--)
|
for (int col = term->cols - 1; col >= 0; col--) {
|
||||||
render_cell(term, pix, damage, row, row_no, col, cursor_col == col, MULTI_CURSOR_SHAPE_NONE);
|
render_cell(term, pix, damage, row, row_no, col,
|
||||||
|
cursor_col == col, MULTI_CURSOR_SHAPE_NONE);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
xassert(term->multi_cursor.shapes != NULL);
|
enum multi_cursor_shape *extra_cursors =
|
||||||
|
&term->multi_cursor.shapes[row_no * term->cols + term->cols - 1];
|
||||||
|
|
||||||
enum multi_cursor_shape *extra_cursors = &term->multi_cursor.shapes[row_no * term->cols];
|
for (int col = term->cols - 1; col >= 0; col--, extra_cursors--) {
|
||||||
for (int col = term->cols - 1; col >= 0; col--)
|
render_cell(term, pix, damage, row, row_no, col,
|
||||||
render_cell(term, pix, damage, row, row_no, col, cursor_col == col, extra_cursors[col]);
|
cursor_col == col, *extra_cursors);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue