Repository: godotengine/godot (language: cpp)

Issue:
Tree's Relationship Guides do not render properly if Hide Folding is enabled.
### Tested versions

- Reproducible in: 4.4-stable

### System information

Godot v4.4.stable - Windows 11 (build 26100) - Multi-window, 2 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3080 Ti (NVIDIA; 32.0.15.7270) - AMD Ryzen 7 3700X 8-Core Processor (16 threads)

### Issue description

![Image](https://github.com/user-attachments/assets/d409475d-b606-46c7-a4eb-fc3f7ac32c9c)

![Image](https://github.com/user-attachments/assets/21d6756a-0648-41bf-8a68-aad07dd500ba)

As you can see, the lines for branch nodes go slightly to the left when there is no collapse icon. 

### Steps to reproduce

Create a tree, hide folding, override relationship lines to a positive value in the theme.

### Minimal reproduction project (MRP)

[tree.zip](https://github.com/user-attachments/files/19326806/tree.zip)


Discussion / hints:
I think the buggy code is here.
![Image](https://github.com/user-attachments/assets/4e94cb7c-3cee-4107-973c-43301e077d60)
I can test and fix it later.
Also test my pr #104201.

Fix patch:
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 2b7e43668da7..5ae294efcf46 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);


Test patch: