summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-09-25 09:13:34 +0200
committerGitHub <noreply@github.com>2021-09-25 09:13:34 +0200
commit9c13e9152fa513bf5fcf5b1cc17dd66f3aae0929 (patch)
tree766891e8a42bd8185b444b722c1299b9c7d845b2
parentde917008fd5fa9244b3a5d05e3ec8c249f19669e (diff)
parent873443756dad48b841fec668d3306bc3991fa4c4 (diff)
Merge pull request #53038 from pycbouh/tree-fix-folding-arrow-with-margin
Correctly calculate position of the folding arrow in `Tree`
-rw-r--r--scene/gui/tree.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index f62c09925d..93409ae9e9 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -1968,7 +1968,8 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
arrow = cache.arrow;
}
- Point2 apos = 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();
if (rtl) {
apos.x = get_size().width - apos.x - arrow->get_width();