Always erase previous cell

Even if we are not drawing a new character in the cell, we should erase
the old one.
This commit is contained in:
Leroy Hopson 2024-02-10 22:49:47 +13:00
parent 8e5fbe72cd
commit b8431e4a93
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA

View file

@ -248,17 +248,17 @@ int Terminal::_draw_cb(struct tsm_screen *con,
term->attr_image->set_pixel(posx + i, posy, Color(attr_flags / 255.0f, 0, 0, 0)); term->attr_image->set_pixel(posx + i, posy, Color(attr_flags / 255.0f, 0, 0, 0));
} }
if (len < 1)
{ // No foreground to draw.
return OK;
}
Vector2 cell_position = Vector2(posx * term->cell_size.x, posy * term->cell_size.y); Vector2 cell_position = Vector2(posx * term->cell_size.x, posy * term->cell_size.y);
Rect2 cell_rect = Rect2(cell_position, term->cell_size); Rect2 cell_rect = Rect2(cell_position, term->cell_size);
// Erase any previous character in the cell. // Erase any previous character in the cell.
term->rs->canvas_item_add_rect(term->char_canvas_item, cell_rect, Color(1, 1, 1, 0)); term->rs->canvas_item_add_rect(term->char_canvas_item, cell_rect, Color(1, 1, 1, 0));
if (len < 1)
{ // No foreground to draw.
return OK;
}
FontType font_type = static_cast<FontType>((attr->bold ? 1 : 0) | (attr->italic ? 2 : 0)); FontType font_type = static_cast<FontType>((attr->bold ? 1 : 0) | (attr->italic ? 2 : 0));
term->fonts[font_type]->draw_char( term->fonts[font_type]->draw_char(