summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2022-06-09 20:19:27 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2022-06-09 20:20:53 +0200
commit08e804b3b718862e92e6b296b914e3829e43717e (patch)
tree3caa0137d7fdae886f808761a97d6ce5a4acb8ab /scene
parentb36447f6f09ac608bfa76dda6a50ac92c7040077 (diff)
Fix infinite loop when calling `Control.popup_centered_minsize()`
Co-authored-by: sriramun <sriramun2@gmail.com>
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/control.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index db78b4adb6..ea923748f0 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -206,6 +206,12 @@ void Control::set_custom_minimum_size(const Size2 &p_custom) {
if (p_custom == data.custom_minimum_size) {
return;
}
+
+ if (isnan(p_custom.x) || isnan(p_custom.y)) {
+ // Prevent infinite loop.
+ return;
+ }
+
data.custom_minimum_size = p_custom;
update_minimum_size();
}