1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

[Complex Text Layouts] Performance optimizations.

This commit is contained in:
bruvzg
2020-12-01 15:03:31 +02:00
parent a41f1c67e5
commit 0ef483e9a9
7 changed files with 211 additions and 124 deletions

View File

@@ -1240,10 +1240,13 @@ void TextEdit::_notification(int p_what) {
ofs_y += (row_height - text_height) / 2;
const Vector<TextServer::Glyph> glyphs = TS->shaped_text_get_glyphs(rid);
const Vector<TextServer::Glyph> visual = TS->shaped_text_get_glyphs(rid);
const TextServer::Glyph *glyphs = visual.ptr();
int gl_size = visual.size();
ofs_y += ldata->get_line_ascent(line_wrap_index);
float char_ofs = 0.f;
for (int j = 0; j < glyphs.size(); j++) {
for (int j = 0; j < gl_size; j++) {
if (color_map.has(glyphs[j].start)) {
current_color = color_map[glyphs[j].start].get("color");
if (readonly && current_color.a > cache.font_color_readonly.a) {