diff --git a/scene/gui/tab_bar.cpp b/scene/gui/tab_bar.cpp index 7e9b56643819..8af73deefb8a 100644 --- a/scene/gui/tab_bar.cpp +++ b/scene/gui/tab_bar.cpp @@ -567,6 +567,8 @@ void TabBar::_draw_tab(Ref &p_tab_style, Color &p_font_color, int p_in rb->draw(ci, Point2i(rb_rect.position.x + style->get_margin(SIDE_LEFT), rb_rect.position.y + style->get_margin(SIDE_TOP))); p_x = rtl ? rb_rect.position.x : rb_rect.position.x + rb_rect.size.width; + } else { + tabs.write[p_index].rb_rect = Rect2(); } // Draw and calculate rect of the close button.