diff options
author | Michael Alexsander <michaelalexsander@protonmail.com> | 2021-10-07 22:38:04 -0300 |
---|---|---|
committer | Michael Alexsander <michaelalexsander@protonmail.com> | 2021-10-07 22:40:11 -0300 |
commit | 3c5103ac1d9a97cfe94978896b50572c2138138f (patch) | |
tree | b825baeb02c7ceaff5673570d9f1804c98fed3d6 /scene | |
parent | 49e7e049aba1dad3d778a4aea4afa23203ad795b (diff) |
Fix invisible tabs not being ignored in `Tabs`
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/tabs.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp index f305bf7013..0755a79eee 100644 --- a/scene/gui/tabs.cpp +++ b/scene/gui/tabs.cpp @@ -223,7 +223,7 @@ void Tabs::gui_input(const Ref<InputEvent> &p_event) { } int found = -1; - for (int i = offset; i < tabs.size(); i++) { + for (int i = offset; i <= max_drawn_tab; i++) { if (tabs[i].rb_rect.has_point(pos)) { rb_pressing = true; update(); @@ -914,7 +914,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 = offset; i < tabs.size(); i++) { + for (int i = offset; i <= max_drawn_tab; i++) { Rect2 rect = get_tab_rect(i); if (rect.has_point(p_point)) { hover_now = i; |