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/grid_container.cpp | |
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/grid_container.cpp')
-rw-r--r-- | scene/gui/grid_container.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/gui/grid_container.cpp b/scene/gui/grid_container.cpp index eaa6943ad2..3163d17846 100644 --- a/scene/gui/grid_container.cpp +++ b/scene/gui/grid_container.cpp @@ -246,6 +246,11 @@ void GridContainer::_notification(int p_what) { void GridContainer::set_columns(int p_columns) { ERR_FAIL_COND(p_columns < 1); + + if (columns == p_columns) { + return; + } + columns = p_columns; queue_sort(); update_minimum_size(); |