mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-27 07:58:07 -04:00
sixel: RA region does not affect the text cursor position
The raster attributes is, really, just a way to erase an area. And, if the sixel is transparent, it's a nop. The final text cursor position depends, not on our image size (which is based on RA), but on the final graphical cursor position. However, we do want to continue using it as a hint of the final image size, to be able to pre-allocate the backing buffer. So, here's what we do: * When trimming trailing transparent rows, only trim the *image*, if the graphical cursor is positioned on the last sixel row, *and* the sixel is transparent. * Opaque sixels aren't trimmed at all, since RA in this acts as an erase that fills the RA region with the background color. * The graphical cursor position is always adjusted (i.e. trimmed), since it affects the text cursor position. * The text cursor position is now calculated from the graphical cursor position, instead of the image height.
This commit is contained in:
parent
cc660bc7c1
commit
cb820a498b
2 changed files with 85 additions and 2 deletions
|
|
@ -677,6 +677,7 @@ struct terminal {
|
|||
uint32_t *p; /* Pointer into data, for current position */
|
||||
int width; /* Image width, in pixels */
|
||||
int height; /* Image height, in pixels */
|
||||
int alloc_height;
|
||||
unsigned int bottom_pixel;
|
||||
} image;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue