Fixes Tree item offset when root is hidden

Before this fix, one vseparation is counted for a hidden root item.
This commit is contained in:
Haoyu Qiu 2020-01-02 09:20:43 +08:00
parent 27b74f42b4
commit 0ee93257e8
1 changed files with 4 additions and 1 deletions

View File

@ -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) {