FIX: Reset to the previous valid value when the input value is invalid

jira: STUDIO-11968
Change-Id: I9fc92c71cdb8737d72306952252623ad3bd59989
(cherry picked from commit d62341f7ee28b2e0ffea4e289dcc785de1c31bc7)
This commit is contained in:
zhimin.zeng 2025-05-20 11:45:46 +08:00 committed by Noisyfox
parent edf92dfffc
commit cb30fd86b5

View file

@ -451,7 +451,7 @@ coordf_t LayerRangeEditor::get_value()
else {
if (!str.ToDouble(&layer_height) || layer_height < 0.0f) {
show_error(m_parent, _L("Invalid numeric."));
SetValue(double_to_string(layer_height));
SetValue(m_valid_value); // reset to a valid value
}
}