mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 06:55:53 +08:00
SPE-2484: Fix the "Input value is out of range" error repeatedly triggered because of lost precision during the conversion of double value to float.
This commit is contained in:
parent
4260d76936
commit
47ee2fbef8
@ -305,9 +305,11 @@ void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true
|
||||
}
|
||||
}
|
||||
else {
|
||||
show_error(m_parent, _L("Input value is out of range"));
|
||||
if (m_opt.min > val) val = m_opt.min;
|
||||
if (val > m_opt.max) val = m_opt.max;
|
||||
if (val < (m_opt.min - EPSILON) || val > (m_opt.max + EPSILON)) {
|
||||
show_error(m_parent, _L("Input value is out of range"));
|
||||
}
|
||||
|
||||
val = std::clamp(static_cast<float>(val), m_opt.min, m_opt.max);
|
||||
set_value(double_to_string(val), true);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user