mirror of
https://github.com/tmux/tmux.git
synced 2025-04-04 23:28:51 +00:00
Fix a case of failure to overwrite sixel image cells
When the cell to be overwritten contained part of an image, no update would be issued if the backing cell character appeared unchanged. We address this by issuing cell updates when the cell intersects with an image, allowing images to e.g. be reliably erased with spaces.
This commit is contained in:
parent
ec119b2f9e
commit
d171978560
15
image.c
15
image.c
@ -149,6 +149,21 @@ image_check_area(struct screen *s, u_int px, u_int py, u_int nx, u_int ny)
|
||||
return (redraw);
|
||||
}
|
||||
|
||||
int
|
||||
image_intersect_area(struct screen *s, u_int px, u_int py, u_int nx, u_int ny)
|
||||
{
|
||||
struct image *im;
|
||||
|
||||
TAILQ_FOREACH(im, &s->images, entry) {
|
||||
if (py + ny <= im->py || py >= im->py + im->sy)
|
||||
continue;
|
||||
if (px + nx <= im->px || px >= im->px + im->sx)
|
||||
continue;
|
||||
return (1);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
image_scroll_up(struct screen *s, u_int lines)
|
||||
{
|
||||
|
@ -2022,6 +2022,10 @@ screen_write_cell(struct screen_write_ctx *ctx, const struct grid_cell *gc)
|
||||
if (skip) {
|
||||
if (s->cx >= gl->cellsize)
|
||||
skip = grid_cells_equal(gc, &grid_default_cell);
|
||||
#ifdef ENABLE_SIXEL
|
||||
else if (image_intersect_area(s, s->cx, s->cy, width, 1))
|
||||
skip = 0;
|
||||
#endif
|
||||
else {
|
||||
gce = &gl->celldata[s->cx];
|
||||
if (gce->flags & GRID_FLAG_EXTENDED)
|
||||
|
1
tmux.h
1
tmux.h
@ -3561,6 +3561,7 @@ int image_free_all(struct screen *);
|
||||
struct image *image_store(struct screen *, struct sixel_image *);
|
||||
int image_check_line(struct screen *, u_int, u_int);
|
||||
int image_check_area(struct screen *, u_int, u_int, u_int, u_int);
|
||||
int image_intersect_area(struct screen *, u_int, u_int, u_int, u_int);
|
||||
int image_scroll_up(struct screen *, u_int);
|
||||
|
||||
/* image-sixel.c */
|
||||
|
Loading…
Reference in New Issue
Block a user