[ItemList] Fix item text positions in RTL mode.

(cherry picked from commit 343c35e7b0)
This commit is contained in:
bruvzg
2023-06-29 16:03:20 +02:00
committed by Yuri Sizov
parent 4edc22ee6e
commit 0b8fee56e2

View File

@@ -1366,11 +1366,12 @@ void ItemList::_notification(int p_what) {
text_ofs += base_ofs;
text_ofs += items[i].rect_cache.position;
if (rtl) {
text_ofs.x = size.width - text_ofs.x - max_len;
}
float text_w = width - text_ofs.x;
items.write[i].text_buf->set_width(text_w);
items.write[i].text_buf->set_width(width - text_ofs.x);
if (rtl) {
text_ofs.x = size.width - width;
}
if (rtl) {
items.write[i].text_buf->set_alignment(HORIZONTAL_ALIGNMENT_RIGHT);