Skip to content

Commit

Permalink
Fix infinite loop when calling Control.popup_centered_minsize()
Browse files Browse the repository at this point in the history
Co-authored-by: sriramun <sriramun2@gmail.com>
  • Loading branch information
Calinou and sriramun committed Jun 9, 2022
1 parent b36447f commit 08e804b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scene/gui/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 08e804b

Please sign in to comment.