Merge pull request #114952 from YeldhamDev/hidden_tabs_offset_fix

Fix wrong offset for `TabBar` with hidden tabs
This commit is contained in:
Rémi Verschelde 2026-01-19 21:45:30 +01:00
commit f5b3183251
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -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--;