mirror of
https://github.com/godotengine/godot.git
synced 2024-11-10 14:12:51 +00:00
Fix unlimited text rendering in Tree if width <= 0
This commit is contained in:
parent
0b1d516f67
commit
0c766ef271
@ -1775,10 +1775,10 @@ void Tree::draw_item_rect(TreeItem::Cell &p_cell, const Rect2i &p_rect, const Co
|
||||
|
||||
RID ci = get_canvas_item();
|
||||
|
||||
if (rtl) {
|
||||
if (rtl && rect.size.width > 0) {
|
||||
Point2 draw_pos = rect.position;
|
||||
draw_pos.y += Math::floor((rect.size.y - p_cell.text_buf->get_size().y) / 2.0);
|
||||
p_cell.text_buf->set_width(MAX(0, rect.size.width));
|
||||
p_cell.text_buf->set_width(rect.size.width);
|
||||
if (p_ol_size > 0 && p_ol_color.a > 0) {
|
||||
p_cell.text_buf->draw_outline(ci, draw_pos, p_ol_size, p_ol_color);
|
||||
}
|
||||
@ -1800,10 +1800,10 @@ void Tree::draw_item_rect(TreeItem::Cell &p_cell, const Rect2i &p_rect, const Co
|
||||
rect.size.x -= bmsize.x + theme_cache.h_separation;
|
||||
}
|
||||
|
||||
if (!rtl) {
|
||||
if (!rtl && rect.size.width > 0) {
|
||||
Point2 draw_pos = rect.position;
|
||||
draw_pos.y += Math::floor((rect.size.y - p_cell.text_buf->get_size().y) / 2.0);
|
||||
p_cell.text_buf->set_width(MAX(0, rect.size.width));
|
||||
p_cell.text_buf->set_width(rect.size.width);
|
||||
if (p_ol_size > 0 && p_ol_color.a > 0) {
|
||||
p_cell.text_buf->draw_outline(ci, draw_pos, p_ol_size, p_ol_color);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user