Merge pull request #42758 from volzhs/tree-selection-box
Respect Tree.set_icon_max_width size for drawing selection box
This commit is contained in:
commit
7b11e8a8a2
1 changed files with 3 additions and 0 deletions
|
@ -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) {
|
if (p_item->cells[i].text.size() > 0) {
|
||||||
float icon_width = p_item->cells[i].get_icon_size().width;
|
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.position.x += icon_width;
|
||||||
r.size.x -= icon_width;
|
r.size.x -= icon_width;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue