diff options
author | volzhs <volzhs@gmail.com> | 2020-10-13 10:38:32 +0900 |
---|---|---|
committer | volzhs <volzhs@gmail.com> | 2020-10-13 10:38:32 +0900 |
commit | cac4fedb2a15699979e062ffa64311249695e7f9 (patch) | |
tree | c7e88cfe1c9e01b469b3e4e69e3c2c06af479726 /scene | |
parent | a22c7eff0f3d443aa18cc962a6c50d066c3bdc2a (diff) |
Respect Tree.set_icon_max_width size for drawing selection box
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/tree.cpp | 3 |
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; } |