diff options
author | 风青山 <idleman@yeah.net> | 2022-03-16 15:50:48 +0800 |
---|---|---|
committer | Rindbee <idleman@yeah.net> | 2022-08-23 23:25:22 +0800 |
commit | e561c68256452286e610dc60ba963987f31595d1 (patch) | |
tree | 29fe4c54691e6d20d75815dbc8bfae8ea88c82f1 /scene/gui/text_edit.h | |
parent | ba0421f3d907b1a3fc94e05f6c20b158e9aa7021 (diff) |
Add some codes, returnes directly if the value is not changed.
Avoid executing the following value-changed logics if the value does not really change.
Diffstat (limited to 'scene/gui/text_edit.h')
-rw-r--r-- | scene/gui/text_edit.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 6711cf8c7f..f97f99075c 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -195,6 +195,9 @@ private: void set(int p_line, const String &p_text, const Array &p_bidi_override); void set_hidden(int p_line, bool p_hidden) { + if (text[p_line].hidden == p_hidden) { + return; + } text.write[p_line].hidden = p_hidden; if (!p_hidden && text[p_line].width > max_width) { max_width = text[p_line].width; |