diff --git a/addons/godot_xterm/native/src/terminal.cpp b/addons/godot_xterm/native/src/terminal.cpp index 7b3233c..4e3b29e 100644 --- a/addons/godot_xterm/native/src/terminal.cpp +++ b/addons/godot_xterm/native/src/terminal.cpp @@ -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((attr->bold ? 1 : 0) | (attr->italic ? 2 : 0)); term->fonts[font_type]->draw_char(