summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-10-13 08:35:21 +0200
committerGitHub <noreply@github.com>2020-10-13 08:35:21 +0200
commit7b11e8a8a2c4c3a23d3ea73badbdfff83d17bea9 (patch)
treec7e88cfe1c9e01b469b3e4e69e3c2c06af479726
parenta22c7eff0f3d443aa18cc962a6c50d066c3bdc2a (diff)
parentcac4fedb2a15699979e062ffa64311249695e7f9 (diff)
Merge pull request #42758 from volzhs/tree-selection-box
Respect Tree.set_icon_max_width size for drawing selection box
-rw-r--r--scene/gui/tree.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 2f5ee20373..318496df70 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;
}