mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
[TextEdit] Fix text edit font update order.
This commit is contained in:
parent
825ef2387f
commit
7368d148c1
1 changed files with 12 additions and 12 deletions
|
@ -319,8 +319,19 @@ void TextEdit::Text::invalidate_cache(int p_line, bool p_text_changed) {
|
|||
}
|
||||
String remaining_string = text_with_ime.substr(from);
|
||||
text_line.data_buf->add_string(remaining_string, font, font_size, language);
|
||||
}
|
||||
if (!bidi_override_with_ime.is_empty()) {
|
||||
TS->shaped_text_set_bidi_override(text_line.data_buf->get_rid(), bidi_override_with_ime);
|
||||
}
|
||||
|
||||
if (!p_text_changed) {
|
||||
// Update fonts.
|
||||
RID r = text_line.data_buf->get_rid();
|
||||
int spans = TS->shaped_get_span_count(r);
|
||||
for (int i = 0; i < spans; i++) {
|
||||
TS->shaped_set_span_update_font(r, i, font->get_rids(), font_size, font->get_opentype_features());
|
||||
}
|
||||
|
||||
} else {
|
||||
// Update inline object sizes.
|
||||
for (int i = 0; i < text_line.data_buf->get_line_count(); i++) {
|
||||
for (Variant key : text_line.data_buf->get_line_objects(i)) {
|
||||
|
@ -333,17 +344,6 @@ void TextEdit::Text::invalidate_cache(int p_line, bool p_text_changed) {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (!bidi_override_with_ime.is_empty()) {
|
||||
TS->shaped_text_set_bidi_override(text_line.data_buf->get_rid(), bidi_override_with_ime);
|
||||
}
|
||||
|
||||
if (!p_text_changed) {
|
||||
RID r = text_line.data_buf->get_rid();
|
||||
int spans = TS->shaped_get_span_count(r);
|
||||
for (int i = 0; i < spans; i++) {
|
||||
TS->shaped_set_span_update_font(r, i, font->get_rids(), font_size, font->get_opentype_features());
|
||||
}
|
||||
}
|
||||
|
||||
// Apply tab align.
|
||||
if (tab_size > 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue