diff --git a/scene/gui/tab_bar.cpp b/scene/gui/tab_bar.cpp index a914f2c110..7e1b87cd63 100644 --- a/scene/gui/tab_bar.cpp +++ b/scene/gui/tab_bar.cpp @@ -1836,12 +1836,10 @@ void TabBar::_ensure_no_over_offset() { int total_w = tabs[max_drawn_tab].ofs_cache + tabs[max_drawn_tab].size_cache - tabs[offset].ofs_cache; for (int i = offset - 1; i >= 0; i--) { - if (tabs[i].hidden) { - continue; + if (!tabs[i].hidden) { + total_w += tabs[i].size_cache; } - total_w += tabs[i].size_cache; - if (total_w < limit_with_buttons) { offset_with_buttons--; offset_with_no_button--;