Skip to content

Commit 5cd1cc1

Browse files
committed
Merge pull request godotengine#114952 from YeldhamDev/hidden_tabs_offset_fix
Fix wrong offset for `TabBar` with hidden tabs
2 parents a40f529 + f273476 commit 5cd1cc1

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

scene/gui/tab_bar.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,12 +1836,10 @@ void TabBar::_ensure_no_over_offset() {
18361836

18371837
int total_w = tabs[max_drawn_tab].ofs_cache + tabs[max_drawn_tab].size_cache - tabs[offset].ofs_cache;
18381838
for (int i = offset - 1; i >= 0; i--) {
1839-
if (tabs[i].hidden) {
1840-
continue;
1839+
if (!tabs[i].hidden) {
1840+
total_w += tabs[i].size_cache;
18411841
}
18421842

1843-
total_w += tabs[i].size_cache;
1844-
18451843
if (total_w < limit_with_buttons) {
18461844
offset_with_buttons--;
18471845
offset_with_no_button--;

0 commit comments

Comments
 (0)