Fix invisible tabs not being ignored in Tabs

(cherry picked from commit 3c5103ac1d)
This commit is contained in:
Michael Alexsander 2021-10-07 22:38:04 -03:00 committed by Rémi Verschelde
parent 64d70d28d4
commit eeb6652436
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -183,11 +183,7 @@ void Tabs::_gui_input(const Ref<InputEvent> &p_event) {
}
int found = -1;
for (int i = 0; i < tabs.size(); i++) {
if (i < offset) {
continue;
}
for (int i = offset; i <= max_drawn_tab; i++) {
if (tabs[i].rb_rect.has_point(pos)) {
rb_pressing = true;
update();
@ -750,11 +746,7 @@ void Tabs::drop_data(const Point2 &p_point, const Variant &p_data) {
int Tabs::get_tab_idx_at_point(const Point2 &p_point) const {
int hover_now = -1;
for (int i = 0; i < tabs.size(); i++) {
if (i < offset) {
continue;
}
for (int i = offset; i <= max_drawn_tab; i++) {
Rect2 rect = get_tab_rect(i);
if (rect.has_point(p_point)) {
hover_now = i;