Fix wrong offset for TabBar with hidden tabs

This commit is contained in:
Michael Alexsander 2026-01-14 12:49:19 -03:00
parent 481f36ed20
commit 1218413a94
No known key found for this signature in database
GPG key ID: A9C91EE110F4EABA

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