@@ -532,21 +532,19 @@ void TabBar::_notification(int p_what) {
532
532
x = tab_rect.position .x ;
533
533
}
534
534
}
535
+ } else if (get_local_mouse_position ().x > tab_rect.position .x + tab_rect.size .width / 2 ) {
536
+ if (closest_tab < max_drawn_tab) { // On right side of closest_tab and not last tab.
537
+ Rect2 next_tab_rect = get_tab_rect (closest_tab + 1 );
538
+ x = (tab_rect.position .x + tab_rect.size .width + next_tab_rect.position .x ) / 2 ;
539
+ } else { // Last tab, will appear on right edge.
540
+ x = tab_rect.position .x + tab_rect.size .width ;
541
+ }
535
542
} else {
536
- if (get_local_mouse_position ().x > tab_rect.position .x + tab_rect.size .width / 2 ) {
537
- if (closest_tab < max_drawn_tab) { // On right side of closest_tab and not last tab
538
- Rect2 next_tab_rect = get_tab_rect (closest_tab + 1 );
539
- x = (tab_rect.position .x + tab_rect.size .width + next_tab_rect.position .x ) / 2 ;
540
- } else { // Last tab, will appear on right edge
541
- x = tab_rect.position .x + tab_rect.size .width ;
542
- }
543
- } else {
544
- if (closest_tab > 0 ) { // On left side of closest_tab and not first tab
545
- Rect2 prev_tab_rect = get_tab_rect (closest_tab - 1 );
546
- x = (tab_rect.position .x + prev_tab_rect.position .x + prev_tab_rect.size .width ) / 2 ;
547
- } else { // First tab, will appear on left edge
548
- x = tab_rect.position .x ;
549
- }
543
+ if (closest_tab > 0 ) { // On left side of closest_tab and not first tab.
544
+ Rect2 prev_tab_rect = get_tab_rect (closest_tab - 1 );
545
+ x = (tab_rect.position .x + prev_tab_rect.position .x + prev_tab_rect.size .width ) / 2 ;
546
+ } else { // First tab, will appear on left edge.
547
+ x = tab_rect.position .x ;
550
548
}
551
549
}
552
550
} else {
0 commit comments