Truncate instead of rounding to deal with negative values

switch-to-ppa
Evil Eye 3 years ago
parent 6f5e0e7697
commit f18b8adfea

@ -11,7 +11,7 @@ namespace
// Round value to prevent precision issues
void truncate(float& value)
{
value = std::roundf(value * 1024.f) / 1024.f;
value = static_cast<int>(value * 1024.f) / 1024.f;
}
}

Loading…
Cancel
Save