summaryrefslogtreecommitdiff
path: root/scene/gui/control.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-07-01 15:14:31 +0200
committerGitHub <noreply@github.com>2018-07-01 15:14:31 +0200
commit82e03b206652c23c8f79e7844cba9152a5d705cb (patch)
tree8925c16a0aa373a924c3bce859e5c844180d79ce /scene/gui/control.cpp
parentc17221b619d48b29ec2d79f8717f8786ceba4ca9 (diff)
parentb2e78e117ca5560f5b9290b2f333d054b9756a3e (diff)
Merge pull request #19871 from guilhermefelipecgs/fix_performance_ui
Fix performance for godot's interface
Diffstat (limited to 'scene/gui/control.cpp')
-rw-r--r--scene/gui/control.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 18a0cd13d9..6ef8016dd5 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -160,9 +160,16 @@ void Control::_update_minimum_size_cache() {
Size2 minsize = get_minimum_size();
minsize.x = MAX(minsize.x, data.custom_minimum_size.x);
minsize.y = MAX(minsize.y, data.custom_minimum_size.y);
+
+ bool size_changed = false;
+ if (data.minimum_size_cache != minsize)
+ size_changed = true;
+
data.minimum_size_cache = minsize;
data.minimum_size_valid = true;
- minimum_size_changed();
+
+ if (size_changed)
+ minimum_size_changed();
}
Size2 Control::get_combined_minimum_size() const {