mirror of
https://github.com/lihop/godot-xterm.git
synced 2024-11-25 02:30:27 +01:00
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:
parent
8e5fbe72cd
commit
b8431e4a93
1 changed files with 5 additions and 5 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
if (len < 1)
|
||||
{ // No foreground to draw.
|
||||
return OK;
|
||||
}
|
||||
|
||||
Vector2 cell_position = Vector2(posx * term->cell_size.x, posy * term->cell_size.y);
|
||||
Rect2 cell_rect = Rect2(cell_position, term->cell_size);
|
||||
|
||||
// Erase any previous character in the cell.
|
||||
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));
|
||||
|
||||
term->fonts[font_type]->draw_char(
|
||||
|
|
Loading…
Reference in a new issue