From cac4fedb2a15699979e062ffa64311249695e7f9 Mon Sep 17 00:00:00 2001 From: volzhs Date: Tue, 13 Oct 2020 10:38:32 +0900 Subject: [PATCH] Respect Tree.set_icon_max_width size for drawing selection box --- scene/gui/tree.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 2f5ee203736..318496df703 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -1173,6 +1173,9 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2 if (p_item->cells[i].text.size() > 0) { float icon_width = p_item->cells[i].get_icon_size().width; + if (p_item->get_icon_max_width(i) > 0) { + icon_width = p_item->get_icon_max_width(i); + } r.position.x += icon_width; r.size.x -= icon_width; }