Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RTL] Fix nested ordered lists inside unordered lists. #92745

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions scene/gui/rich_text_label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,25 +690,32 @@ int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_o
_find_list(l.from, list_index, list_items);

String prefix;
int segments = 0;
for (int i = 0; i < list_index.size(); i++) {
String segment;
if (list_items[i]->list_type == LIST_DOTS) {
if (segments == 0) {
prefix = list_items[i]->bullet;
}
break;
}
if (rtl) {
prefix = prefix + ".";
} else {
prefix = "." + prefix;
}
String segment;
if (list_items[i]->list_type == LIST_DOTS) {
prefix = list_items[i]->bullet;
break;
} else if (list_items[i]->list_type == LIST_NUMBERS) {
if (list_items[i]->list_type == LIST_NUMBERS) {
segment = itos(list_index[i]);
if (is_localizing_numeral_system()) {
segment = TS->format_number(segment, _find_language(l.from));
}
segments++;
} else if (list_items[i]->list_type == LIST_LETTERS) {
segment = _letters(list_index[i], list_items[i]->capitalize);
segments++;
} else if (list_items[i]->list_type == LIST_ROMAN) {
segment = _roman(list_index[i], list_items[i]->capitalize);
segments++;
}
if (rtl) {
prefix = prefix + segment;
Expand Down
Loading