diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-10-27 12:46:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-27 12:46:50 +0100 |
commit | 77075c28880c2d09150421a13a5caf77d46996ca (patch) | |
tree | aba2e8b468c4ec61da7ff1db9414d8fdca98e2f2 /scene/gui/text_edit.cpp | |
parent | 9e572b5bacdaeb5079415d276bbf5b8462cac9e3 (diff) | |
parent | 2e2a049d3ccff4e7b804c022e673d3efe2eb65c1 (diff) |
Merge pull request #33105 from Paulb23/issue_32236_script_conection_performance
Improve performance of connection info in the script editor
Diffstat (limited to 'scene/gui/text_edit.cpp')
-rw-r--r-- | scene/gui/text_edit.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index ae9c7c88d8..aca5177a9f 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -269,6 +269,12 @@ void TextEdit::Text::clear_wrap_cache() { } } +void TextEdit::Text::clear_info_icons() { + for (int i = 0; i < text.size(); i++) { + text.write[i].has_info = false; + } +} + void TextEdit::Text::clear() { text.clear(); @@ -303,6 +309,7 @@ void TextEdit::Text::insert(int p_at, const String &p_text) { line.breakpoint = false; line.bookmark = false; line.hidden = false; + line.has_info = false; line.width_cache = -1; line.wrap_amount_cache = -1; line.data = p_text; @@ -5663,9 +5670,7 @@ void TextEdit::set_line_info_icon(int p_line, Ref<Texture> p_icon, String p_info } void TextEdit::clear_info_icons() { - for (int i = 0; i < text.size(); i++) { - text.set_info_icon(i, NULL, ""); - } + text.clear_info_icons(); update(); } |