grid: reflow: delete sixels that end up crossing the scrollback wrap around

Our sixel handling code requires sixels to *not* cross the scrollback
wrap around.

Until we've fixes the reflow code that split up such sixels (much like
we do when we generate a sixel), simply delete it.
This commit is contained in:
Daniel Eklöf 2020-06-27 20:16:39 +02:00
parent ad8f293d96
commit deb61d20d8
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

11
grid.c
View file

@ -123,11 +123,12 @@ grid_reflow(struct grid *grid, int new_rows, int new_cols,
struct sixel six = it->item;
six.pos.row = new_row_idx;
/* TODO: ensure sixels don't span across the wrap-around */
int end __attribute__((unused)) = (six.pos.row + six.rows - 1) & (new_rows - 1);
assert(end >= six.pos.row);
tll_push_back(new_sixels, six);
int end = (six.pos.row + six.rows - 1) & (new_rows - 1);
if (end < six.pos.row) {
/* TODO: split sixel instead of removing it... */
sixel_destroy(&it->item);
} else
tll_push_back(new_sixels, six);
tll_remove(grid->sixel_images, it);
}
}