We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 82ce2fd + efb580e commit 89f32c6Copy full SHA for 89f32c6
scene/gui/range.cpp
@@ -44,7 +44,7 @@ double Range::_snapped_r128(double p_value, double p_step) {
44
// R128 is fixed-precision with 64 bits after the decimal point, but double already uses 53 of those,
45
// so a step size finer than 2^-11 will lose precision, and in practice even 1e-3 can be problematic.
46
// By rescaling the value and step, we can shift precision into the higher bits (effectively turning R128 into a makeshift float).
47
- const int decimals = 14 - Math::floor(std::log10(MAX(Math::abs(p_value), p_step)));
+ const int decimals = MIN(18, 14 - Math::floor(std::log10(MAX(Math::abs(p_value), p_step))));
48
const double scale = Math::pow(10.0, decimals);
49
p_value *= scale;
50
p_step *= scale;
0 commit comments