1
0
Fork 0

Fix infinite loop when calling `Control.popup_centered_minsize()`

Co-authored-by: sriramun <sriramun2@gmail.com>
This commit is contained in:
Hugo Locurcio 2022-06-09 20:19:27 +02:00
parent b36447f6f0
commit 08e804b3b7
No known key found for this signature in database
GPG Key ID: 39E8F8BE30B0A49C
1 changed files with 6 additions and 0 deletions

View File

@ -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();
}