diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-01-02 08:17:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-02 08:17:29 +0100 |
commit | 1788b22b118db02ed57487c62157f83ab73b4165 (patch) | |
tree | 2aaeb58b3707c4cdef63a480489dd93291d633df /scene | |
parent | ca3819036351c296edb58e56613e318b1ac48877 (diff) | |
parent | 0ee93257e8b6ab275df5eb8decdcdbf8c9adec56 (diff) |
Merge pull request #34737 from timothyqiu/tree-item-offset
Fixes Tree item offset when root is hidden
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/tree.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index f9d1b9e49a..3cf17bd210 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -3426,7 +3426,10 @@ int Tree::get_item_offset(TreeItem *p_item) const { if (it == p_item) return ofs; - ofs += compute_item_height(it) + cache.vseparation; + ofs += compute_item_height(it); + if (it != root || !hide_root) { + ofs += cache.vseparation; + } if (it->children && !it->collapsed) { |