[RTL] Fix nested ordered lists inside unordered lists.
This commit is contained in:
parent
5f1184e93f
commit
5e616cedd4
1 changed files with 12 additions and 5 deletions
|
@ -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);
|
_find_list(l.from, list_index, list_items);
|
||||||
|
|
||||||
String prefix;
|
String prefix;
|
||||||
|
int segments = 0;
|
||||||
for (int i = 0; i < list_index.size(); i++) {
|
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) {
|
if (rtl) {
|
||||||
prefix = prefix + ".";
|
prefix = prefix + ".";
|
||||||
} else {
|
} else {
|
||||||
prefix = "." + prefix;
|
prefix = "." + prefix;
|
||||||
}
|
}
|
||||||
String segment;
|
if (list_items[i]->list_type == LIST_NUMBERS) {
|
||||||
if (list_items[i]->list_type == LIST_DOTS) {
|
|
||||||
prefix = list_items[i]->bullet;
|
|
||||||
break;
|
|
||||||
} else if (list_items[i]->list_type == LIST_NUMBERS) {
|
|
||||||
segment = itos(list_index[i]);
|
segment = itos(list_index[i]);
|
||||||
if (is_localizing_numeral_system()) {
|
if (is_localizing_numeral_system()) {
|
||||||
segment = TS->format_number(segment, _find_language(l.from));
|
segment = TS->format_number(segment, _find_language(l.from));
|
||||||
}
|
}
|
||||||
|
segments++;
|
||||||
} else if (list_items[i]->list_type == LIST_LETTERS) {
|
} else if (list_items[i]->list_type == LIST_LETTERS) {
|
||||||
segment = _letters(list_index[i], list_items[i]->capitalize);
|
segment = _letters(list_index[i], list_items[i]->capitalize);
|
||||||
|
segments++;
|
||||||
} else if (list_items[i]->list_type == LIST_ROMAN) {
|
} else if (list_items[i]->list_type == LIST_ROMAN) {
|
||||||
segment = _roman(list_index[i], list_items[i]->capitalize);
|
segment = _roman(list_index[i], list_items[i]->capitalize);
|
||||||
|
segments++;
|
||||||
}
|
}
|
||||||
if (rtl) {
|
if (rtl) {
|
||||||
prefix = prefix + segment;
|
prefix = prefix + segment;
|
||||||
|
|
Loading…
Reference in a new issue