Don't commit changes on paint events or updateUI events.

Also use std::numeric_limits::epsilon for comparing doubles.

Fixes https://gitlab.com/kicad/code/kicad/issues/13851
This commit is contained in:
Jeff Young
2023-03-04 00:10:01 +00:00
parent d1b7fa6b0f
commit d714ff8549
3 changed files with 24 additions and 19 deletions
+6
View File
@@ -451,3 +451,9 @@ int SIM_VALUE::ToInt( const std::string& aString, int aDefault )
return aDefault;
}
bool SIM_VALUE::Equal( double aLH, const std::string& aRH )
{
return std::abs( aLH - ToDouble( aRH ) ) <= std::numeric_limits<double>::epsilon();
}