Skip to content

Commit

Permalink
Only allow finite numbers in Range.value.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordyfel committed Aug 28, 2023
1 parent 713bfaf commit 7830428
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scene/gui/range.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ void Range::set_value(double p_val) {
}

void Range::_set_value_no_signal(double p_val) {
if (!Math::is_finite(p_val)) {
return;
}

if (shared->step > 0) {
p_val = Math::round((p_val - shared->min) / shared->step) * shared->step + shared->min;
}
Expand Down

0 comments on commit 7830428

Please sign in to comment.