diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-09-28 10:36:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-28 10:36:47 +0200 |
commit | 77ca3c20d81a8b2554176d56a2b0d67f49a34638 (patch) | |
tree | 8b91eac216b3e201407db2a9d0eed0dbe82e1c4d | |
parent | b2e07dd308dccbe388cf5c8691a55d356201f3fc (diff) | |
parent | 1ac936f035a6aaf62b6c2b3c58a558477ba29eea (diff) |
Merge pull request #42092 from DashCell/dropping_file_on_parrent_directory_fix
Dropping file on parent directory fixed
-rw-r--r-- | scene/gui/tree.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index f6636cf392..070948237a 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -1208,8 +1208,9 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2 if (drop_mode_flags && drop_mode_over == p_item) { Rect2 r = cell_rect; + bool has_parent = p_item->get_children() != nullptr; - if (drop_mode_section == -1 || drop_mode_section == 0) { + if (drop_mode_section == -1 || has_parent || drop_mode_section == 0) { RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x, r.position.y, r.size.x, 1), cache.drop_position_color); } @@ -1218,7 +1219,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2 RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x + r.size.x - 1, r.position.y, 1, r.size.y), cache.drop_position_color); } - if (drop_mode_section == 1 || drop_mode_section == 0) { + if ((drop_mode_section == 1 && !has_parent) || drop_mode_section == 0) { RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x, r.position.y + r.size.y, r.size.x, 1), cache.drop_position_color); } } |