mirror of
https://github.com/godotengine/godot.git
synced 2024-11-10 14:12:51 +00:00
Merge pull request #81076 from Jordyfel/spinbox
Only allow finite numbers in `Range.value`.
This commit is contained in:
commit
541674d106
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user