Skip to content

Commit 8f052a4

Browse files
committed
Merge pull request #109814 from aaronp64/textedit_object_center
Update `TextEdit` to use center alignment for inline objects
2 parents c8e0845 + 019f4ab commit 8f052a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scene/gui/text_edit.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ void TextEdit::Text::invalidate_cache(int p_line, bool p_text_changed) {
312312
float width_ratio = info["width_ratio"];
313313
String left_string = text_with_ime.substr(from, start - from);
314314
text_line.data_buf->add_string(left_string, font, font_size, language);
315-
text_line.data_buf->add_object(info, Vector2(font_height * width_ratio, font_height), INLINE_ALIGNMENT_TOP, 0);
315+
text_line.data_buf->add_object(info, Vector2(font_height * width_ratio, font_height), INLINE_ALIGNMENT_CENTER, 0);
316316
from = start;
317317
}
318318
}
@@ -329,7 +329,7 @@ void TextEdit::Text::invalidate_cache(int p_line, bool p_text_changed) {
329329
}
330330
Dictionary info = key;
331331
float width_ratio = info["width_ratio"];
332-
text_line.data_buf->resize_object(info, Vector2(font_height * width_ratio, font_height), INLINE_ALIGNMENT_TOP, 0);
332+
text_line.data_buf->resize_object(info, Vector2(font_height * width_ratio, font_height), INLINE_ALIGNMENT_CENTER, 0);
333333
}
334334
}
335335
}

0 commit comments

Comments
 (0)