diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-06-27 18:16:39 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-06-27 18:16:39 +0000 |
| commit | deb61d20d82bdfc45af2aa51786fa500e53b84bb (patch) | |
| tree | 95ec81f20848f88e923399c92c216440f5103507 /grid.c | |
| parent | terminfo: add remaining keypad keys (diff) | |
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.
Diffstat (limited to 'grid.c')
| -rw-r--r-- | grid.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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); } } |
