From 5c29a7dbc5d34a9de3881eb2894cdf3011d32ef4 Mon Sep 17 00:00:00 2001 From: monkeyman192 Date: Wed, 1 Jun 2022 00:23:33 +1000 Subject: [PATCH] Handle drawing of relationship lines better to take in to account invisible children --- 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 dee5ff3db94..d3e7540790d 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2169,7 +2169,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2 int parent_ofs = p_pos.x + cache.item_margin; Point2i root_pos = Point2i(root_ofs, children_pos.y + label_h / 2) - cache.offset + p_draw_ofs; - if (c->get_first_child() != nullptr) { + if (c->get_visible_child_count() > 0) { root_pos -= Point2i(cache.arrow->get_width(), 0); }