mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-06-30 21:36:33 -04:00
--Bug fixes
-Changes in the xaos grid were not always being processed due to rounding.
This commit is contained in:
@ -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>
|
||||
|
Reference in New Issue
Block a user