--Bug fixes

-Changes in the xaos grid were not always being processed due to rounding.
This commit is contained in:
mfeemster
2016-01-16 11:51:29 -08:00
parent 19385c28b9
commit 0b05f1a394
3 changed files with 28 additions and 24 deletions

View File

@ -65,6 +65,19 @@ static QWidget* SetTabOrder(QWidget* p, QWidget* w1, QWidget* w2)
return w2;
}
/// <summary>
/// Truncates the precision of the value to the specified number of digits
/// after the decimal place.
/// </summary>
/// <param name="val">The value to truncate</param>
/// <param name="digits">The number of digits to leave after the decimal place</param>
/// <returns>The truncated value</returns>
static double TruncPrecision(double val, uint digits)
{
double mult = std::pow(10, digits);
return std::round(mult * val) / mult;
}
/// <summary>
/// Wrapper around QLocale::system().toDouble().
/// </summary>