mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-14 05:33:59 -04:00
sixel: fix cursor positioning when image is split up into several
This commit is contained in:
parent
bce1d7313d
commit
9fcf5977c0
1 changed files with 6 additions and 1 deletions
7
sixel.c
7
sixel.c
|
|
@ -1310,8 +1310,11 @@ sixel_unhook(struct terminal *term)
|
||||||
* Position the text cursor based on the text row
|
* Position the text cursor based on the text row
|
||||||
* touched by the last sixel
|
* touched by the last sixel
|
||||||
*/
|
*/
|
||||||
|
const int pixel_rows = pixel_rows_left > 0
|
||||||
|
? image.original.height
|
||||||
|
: term->sixel.pos.row;
|
||||||
const int term_rows =
|
const int term_rows =
|
||||||
(image.original.height + term->cell_height - 1) / term->cell_height;
|
(pixel_rows + term->cell_height - 1) / term->cell_height;
|
||||||
|
|
||||||
xassert(term_rows <= image.rows);
|
xassert(term_rows <= image.rows);
|
||||||
|
|
||||||
|
|
@ -1324,6 +1327,8 @@ sixel_unhook(struct terminal *term)
|
||||||
? min(image.pos.col + image.cols, term->cols - 1)
|
? min(image.pos.col + image.cols, term->cols - 1)
|
||||||
: image.pos.col));
|
: image.pos.col));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
term->sixel.pos.row -= image.original.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Dirty touched cells, and scroll terminal content if necessary */
|
/* Dirty touched cells, and scroll terminal content if necessary */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue