summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2023-04-12 17:49:52 +0800
committerYuri Sizov <yuris@humnom.net>2023-04-24 16:28:27 +0200
commitdf80e2ae4331f58643c12fa6e4f00ed4d2d0a6e8 (patch)
tree45c49635650a4f78788f75cf481f0887d56c0b1e /scene/gui
parentc1ec270b448bac4ae1c8e1a4b900dde6ffbaedaa (diff)
Tree: Fix offset calculation when there are hidden items
(cherry picked from commit a083c855214722bc02ed2eb48ea808c7f4d756da)
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/tree.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index f8c2e9f4ad..bae2c8a9cb 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -4523,8 +4523,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;
}