Browse Source

Merge pull request #75977 from timothyqiu/invisible-item

Tree: Fix offset calculation when there are hidden items
Rémi Verschelde 2 năm trước cách đây
mục cha
commit
cd03028915
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      scene/gui/tree.cpp

+ 2 - 2
scene/gui/tree.cpp

@@ -4594,8 +4594,8 @@ int Tree::get_item_offset(TreeItem *p_item) const {
 			return ofs;
 		}
 
-		ofs += compute_item_height(it);
-		if (it != root || !hide_root) {
+		if ((it != root || !hide_root) && it->is_visible()) {
+			ofs += compute_item_height(it);
 			ofs += theme_cache.v_separation;
 		}