Skip to content

Commit 1788b22

Browse files
authored
Merge pull request #34737 from timothyqiu/tree-item-offset
Fixes Tree item offset when root is hidden
2 parents ca38190 + 0ee9325 commit 1788b22

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scene/gui/tree.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -3426,7 +3426,10 @@ int Tree::get_item_offset(TreeItem *p_item) const {
34263426
if (it == p_item)
34273427
return ofs;
34283428

3429-
ofs += compute_item_height(it) + cache.vseparation;
3429+
ofs += compute_item_height(it);
3430+
if (it != root || !hide_root) {
3431+
ofs += cache.vseparation;
3432+
}
34303433

34313434
if (it->children && !it->collapsed) {
34323435

0 commit comments

Comments
 (0)