Explorar o código

Merge pull request #34737 from timothyqiu/tree-item-offset

Fixes Tree item offset when root is hidden
Rémi Verschelde %!s(int64=5) %!d(string=hai) anos
pai
achega
1788b22b11
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      scene/gui/tree.cpp

+ 4 - 1
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) {