From f660cdb7cff019b2bf7d2366348b25647acb6704 Mon Sep 17 00:00:00 2001 From: BrotherShort <129957860+BrotherShort@users.noreply.github.com> Date: Wed, 19 Mar 2025 23:22:24 +0800 Subject: [PATCH] Tree: Fix offset relationship lines with Hide Folding --- scene/gui/tree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 2b7e43668da..5ae294efcf4 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2655,7 +2655,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2 int root_ofs = children_pos.x + ((p_item->disable_folding || hide_folding) ? theme_cache.h_separation : theme_cache.item_margin); Point2i root_pos = Point2i(root_ofs, children_pos.y + child_self_height / 2) - theme_cache.offset + p_draw_ofs; - if (c->get_visible_child_count() > 0) { + if (!hide_folding && !p_item->disable_folding && c->get_visible_child_count() > 0) { root_pos -= Point2i(theme_cache.arrow->get_width(), 0); } root_pos.x = MIN(root_pos.x, get_column_width(0) + p_draw_ofs.x);