From 020807dc0f0b324f8198d3492ba5923310a5fb27 Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Sat, 25 Sep 2021 02:01:35 +0300 Subject: [PATCH] Correctly calculate position of the folding arrow in Tree --- scene/gui/tree.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index d9f4ca3cacb..d2df23c31b5 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -1404,7 +1404,10 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2 arrow = cache.arrow; } - arrow->draw(ci, p_pos + p_draw_ofs + Point2i(0, (label_h - arrow->get_height()) / 2) - cache.offset); + Point2 apos = p_pos + Point2i(0, (label_h - arrow->get_height()) / 2) - cache.offset + p_draw_ofs; + apos.x += cache.item_margin - arrow->get_width(); + + arrow->draw(ci, apos); } }