diff options
author | albertfay1121 <albertfay1121@gmail.com> | 2022-02-23 12:31:51 -0800 |
---|---|---|
committer | albertfay1121 <albertfay1121@gmail.com> | 2022-02-25 13:45:38 -0800 |
commit | dba0d5234989580117ddf6c7bec63364cac627b7 (patch) | |
tree | 36e4e75ac4ade833440b1abfa73df2a8b9ff069a /scene/gui/item_list.cpp | |
parent | 90d16a32109351dea7684f437436c63cc414f51d (diff) | |
download | redot-engine-dba0d5234989580117ddf6c7bec63364cac627b7.tar.gz |
Fixed bug with text going under scrollbar
added classes reference update
Diffstat (limited to 'scene/gui/item_list.cpp')
-rw-r--r-- | scene/gui/item_list.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 9585b4d51d..e83524b06c 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -1241,7 +1241,7 @@ void ItemList::_notification(int p_what) { text_ofs.x = size.width - text_ofs.x - max_len; } - items.write[i].text_buf->set_width(max_len); + items.write[i].text_buf->set_width(width - text_ofs.x); if (rtl) { items.write[i].text_buf->set_alignment(HORIZONTAL_ALIGNMENT_RIGHT); @@ -1253,7 +1253,9 @@ void ItemList::_notification(int p_what) { items[i].text_buf->draw_outline(get_canvas_item(), text_ofs, outline_size, font_outline_color); } - items[i].text_buf->draw(get_canvas_item(), text_ofs, modulate); + if (width - text_ofs.x > 0) { + items[i].text_buf->draw(get_canvas_item(), text_ofs, modulate); + } } } |