Fix crash from overflowing values given to NumberInput widgets (#1377)

* Added hints for brush tool size

* Added hints for brush tool size

* Solved the user being able to crash the editor by overflowing NumberInputs
This commit is contained in:
Omar Magdy
2023-08-11 12:26:37 -07:00
committed by Keavon Chambers
parent 1c11ebcc4e
commit fd338c945f
16 changed files with 47 additions and 4 deletions
@@ -58,6 +58,7 @@ impl PreferencesDialogMessageHandler {
NumberInput::new(Some(preferences.imaginate_refresh_frequency))
.unit(" seconds")
.min(0.)
.max((1u64 << std::f64::MANTISSA_DIGITS) as f64)
.min_width(200)
.on_update(|number_input: &NumberInput| PreferencesMessage::ImaginateRefreshFrequency { seconds: number_input.value.unwrap() }.into())
.widget_holder(),