diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-08-03 09:34:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-03 09:34:51 +0200 |
commit | e0b560fb6f3002d98bfcb8f1b015ab19e96e3466 (patch) | |
tree | e9f020f7d10894f8b9a1526b2913bb8c62fd7e70 /scene/gui | |
parent | 0f8cba285b2d71ded9e5e0fc5cdf6cc79b3eef55 (diff) | |
parent | a5a4532378792f94ac97cf0c9abcbbc3625bb4b3 (diff) |
Merge pull request #51177 from kleonc/tab_container-drop-tab-index-fix
TabContainer Fix moving dropped tab to incorrect child index
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/tab_container.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 4b8c4b3e16..cc41d961f6 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -899,7 +899,7 @@ void TabContainer::drop_data(const Point2 &p_point, const Variant &p_data) { if (hover_now < 0) { hover_now = get_tab_count() - 1; } - move_child(get_tab_control(tab_from_id), hover_now); + move_child(get_tab_control(tab_from_id), get_tab_control(hover_now)->get_index()); set_current_tab(hover_now); } else if (get_tabs_rearrange_group() != -1) { // drag and drop between TabContainers @@ -912,7 +912,7 @@ void TabContainer::drop_data(const Point2 &p_point, const Variant &p_data) { if (hover_now < 0) { hover_now = get_tab_count() - 1; } - move_child(moving_tabc, hover_now); + move_child(moving_tabc, get_tab_control(hover_now)->get_index()); set_current_tab(hover_now); emit_signal(SNAME("tab_changed"), hover_now); } |