mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-25 06:46:36 -04:00
sixel: adjust image height when processing ‘-’
This commit is contained in:
parent
891e0819f0
commit
1c9c1aafc8
1 changed files with 8 additions and 8 deletions
16
sixel.c
16
sixel.c
|
|
@ -921,23 +921,20 @@ sixel_add(struct terminal *term, uint32_t color, uint8_t sixel)
|
||||||
{
|
{
|
||||||
//LOG_DBG("adding sixel %02hhx using color 0x%06x", sixel, color);
|
//LOG_DBG("adding sixel %02hhx using color 0x%06x", sixel, color);
|
||||||
|
|
||||||
int height = term->sixel.image.height;
|
|
||||||
int width = term->sixel.image.width;
|
int width = term->sixel.image.width;
|
||||||
|
|
||||||
if (term->sixel.pos.col >= width ||
|
if (term->sixel.pos.col >= width) {
|
||||||
term->sixel.pos.row >= height)
|
|
||||||
{
|
|
||||||
width = max(
|
width = max(
|
||||||
term->sixel.image.width,
|
term->sixel.image.width,
|
||||||
max(term->sixel.max_col, term->sixel.pos.col + 1));
|
max(term->sixel.max_col, term->sixel.pos.col + 1));
|
||||||
|
|
||||||
height = max(
|
if (!resize(term, width, term->sixel.image.height))
|
||||||
term->sixel.image.height, term->sixel.pos.row + 6);
|
|
||||||
|
|
||||||
if (!resize(term, width, height))
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Height adjustment done while processing ‘-’ */
|
||||||
|
xassert(term->sixel.pos.row < term->sixel.image.height);
|
||||||
|
|
||||||
size_t ofs = term->sixel.row_byte_ofs + term->sixel.pos.col;
|
size_t ofs = term->sixel.row_byte_ofs + term->sixel.pos.col;
|
||||||
uint32_t *data = term->sixel.image.data;
|
uint32_t *data = term->sixel.image.data;
|
||||||
|
|
||||||
|
|
@ -985,6 +982,9 @@ decsixel(struct terminal *term, uint8_t c)
|
||||||
term->sixel.pos.row += 6;
|
term->sixel.pos.row += 6;
|
||||||
term->sixel.pos.col = 0;
|
term->sixel.pos.col = 0;
|
||||||
term->sixel.row_byte_ofs += term->sixel.image.width * 6;
|
term->sixel.row_byte_ofs += term->sixel.image.width * 6;
|
||||||
|
|
||||||
|
if (term->sixel.pos.row >= term->sixel.image.height)
|
||||||
|
resize(term, term->sixel.image.width, term->sixel.pos.row + 6);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '?': case '@': case 'A': case 'B': case 'C': case 'D': case 'E':
|
case '?': case '@': case 'A': case 'B': case 'C': case 'D': case 'E':
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue