diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2020-01-02 09:20:43 +0800 |
---|---|---|
committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2020-01-02 09:20:43 +0800 |
commit | 0ee93257e8b6ab275df5eb8decdcdbf8c9adec56 (patch) | |
tree | 5c65ed56f7edc8c0e46c66b223b488ff0a55c264 /scene/gui | |
parent | 27b74f42b4fd6b6e56b7a4924697d8881488bee1 (diff) |
Fixes Tree item offset when root is hidden
Before this fix, one vseparation is counted for a hidden root item.
Diffstat (limited to 'scene/gui')
-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) { |