Fix DECCARA in non-rectangular mode for a single line

This commit is contained in:
Kovid Goyal 2023-03-28 08:02:44 +05:30
parent d19f28f2b4
commit 0f59a2d543
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -784,6 +784,12 @@ select_graphic_rendition(Screen *self, int *params, unsigned int count, Region *
} }
} else { } else {
index_type x, num; index_type x, num;
if (region.top == region.bottom) {
linebuf_init_line(self->linebuf, region.top);
x = MIN(region.left, self->columns-1);
num = MIN(self->columns - x, region.right - x + 1);
apply_sgr_to_cells(self->linebuf->line->gpu_cells + x, num, params, count);
} else {
for (index_type y = region.top; y < MIN(region.bottom + 1, self->lines); y++) { for (index_type y = region.top; y < MIN(region.bottom + 1, self->lines); y++) {
if (y == region.top) { x = MIN(region.left, self->columns - 1); num = self->columns - x; } if (y == region.top) { x = MIN(region.left, self->columns - 1); num = self->columns - x; }
else if (y == region.bottom) { x = 0; num = MIN(region.right + 1, self->columns); } else if (y == region.bottom) { x = 0; num = MIN(region.right + 1, self->columns); }
@ -792,6 +798,7 @@ select_graphic_rendition(Screen *self, int *params, unsigned int count, Region *
apply_sgr_to_cells(self->linebuf->line->gpu_cells + x, num, params, count); apply_sgr_to_cells(self->linebuf->line->gpu_cells + x, num, params, count);
} }
} }
}
} else cursor_from_sgr(self->cursor, params, count); } else cursor_from_sgr(self->cursor, params, count);
} }