summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-02-09 12:51:26 +0100
committerGitHub <noreply@github.com>2020-02-09 12:51:26 +0100
commit480bfbd42ea53d3b0e66bb6cd54b30eff1bf9634 (patch)
tree237f72c2e07819b3ee6a17aad1fc26b851de89f2
parentea31f362e964238165f80697dbb0d892ed4ac022 (diff)
parent830dd5cd8d7dd20d77b5f355e1c4bda3932c2ba9 (diff)
Merge pull request #36039 from YeldhamDev/tree_text_clip_fix
Fix text clipping in Tree items not working with negative values
-rw-r--r--scene/gui/tree.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 964f376dbd..6e38a0aa1f 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -1121,7 +1121,7 @@ void Tree::draw_item_rect(const TreeItem::Cell &p_cell, const Rect2i &p_rect, co
}
rect.position.y += Math::floor((rect.size.y - font->get_height()) / 2.0) + font->get_ascent();
- font->draw(ci, rect.position, text, p_color, rect.size.x);
+ font->draw(ci, rect.position, text, p_color, MAX(0, rect.size.width));
}
int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2 &p_draw_size, TreeItem *p_item) {