diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-01-05 10:56:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-05 10:56:50 +0100 |
commit | 319c442771f356cb6aab8a09fe59399e71d32818 (patch) | |
tree | 3c2dba61241eefbe299240c74ea68d9c9975040f | |
parent | e32c6850920d852b97e0dad3f5d10d21db7d4788 (diff) | |
parent | 67dd4f15ee8fe44d9388c781bf9688f39afc4740 (diff) |
Merge pull request #55791 from kleonc/tree-dont-consume-mouse-if-collapser-not-visible
-rw-r--r-- | scene/gui/tree.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 84d51effd8..73d39aee8a 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2318,12 +2318,9 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, int return -1; } - if (!p_item->disable_folding && !hide_folding && (p_pos.x >= x_ofs && p_pos.x < (x_ofs + cache.item_margin))) { - if (p_item->first_child) { - p_item->set_collapsed(!p_item->is_collapsed()); - } - - return -1; //handled! + if (!p_item->disable_folding && !hide_folding && p_item->first_child && (p_pos.x >= x_ofs && p_pos.x < (x_ofs + cache.item_margin))) { + p_item->set_collapsed(!p_item->is_collapsed()); + return -1; } int x = p_pos.x; |