From 1218413a941be7cc53a36dce9e722b1c4df2932d Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Wed, 14 Jan 2026 12:49:19 -0300 Subject: [PATCH] Fix wrong offset for `TabBar` with hidden tabs --- scene/gui/tab_bar.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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--;