mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-12-02 09:48:14 -05:00
Fix: Fixed the values comparison for Float-based config options (#12478)
This commit is contained in:
1 parent
3a61fefa3a
commit
76436bb29a
2 files changed
+22
-9
No files matched your search
@@ -883,13 +883,18 @@ bool TextCtrl::value_was_changed()
|
||||
case coInt:
|
||||
return boost::any_cast<int>(m_value) != boost::any_cast<int>(val);
|
||||
case coPercent:
|
||||
case coPercents:
|
||||
case coPercents: {
|
||||
if (m_opt.nullable && std::isnan(boost::any_cast<double>(m_value)) &&
|
||||
std::isnan(boost::any_cast<double>(val)))
|
||||
return false;
|
||||
return boost::any_cast<double>(m_value) != boost::any_cast<double>(val);
|
||||
}
|
||||
case coFloats:
|
||||
case coFloat: {
|
||||
if (m_opt.nullable && std::isnan(boost::any_cast<double>(m_value)) &&
|
||||
std::isnan(boost::any_cast<double>(val)))
|
||||
return false;
|
||||
return boost::any_cast<double>(m_value) != boost::any_cast<double>(val);
|
||||
return !is_approx(boost::any_cast<double>(m_value), boost::any_cast<double>(val));
|
||||
}
|
||||
case coString:
|
||||
case coStrings:
|
||||
|
||||
Reference in new issue
Block a user