Fix: Fixed the values comparison for Float-based config options (#12478)

This commit is contained in:
Valerii Bokhan
2026-02-26 13:28:45 +01:00
committed by GitHub
parent f0e5c76e5e
commit 076e384be9
2 changed files with 22 additions and 9 deletions

View File

@@ -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: