UI: fix a precision issue with float field step size.
Fix a precision issue when stepping down from 1 to 0 via the left decrement button and step 100 results in a small nonzero value. The reason is that 0.01 can't be precisely represented in binary and converting to double before multiplication reveals this. Ref D13753
This commit is contained in:
parent
6a8ad00bcc
commit
6952228386
|
@ -5484,7 +5484,7 @@ static int ui_do_but_NUM(
|
|||
log10f(number_but->step_size));
|
||||
}
|
||||
else {
|
||||
value_step = (double)number_but->step_size * UI_PRECISION_FLOAT_SCALE;
|
||||
value_step = (double)(number_but->step_size * UI_PRECISION_FLOAT_SCALE);
|
||||
}
|
||||
BLI_assert(value_step > 0.0f);
|
||||
const double value_test = (but->drawflag & UI_BUT_ACTIVE_LEFT) ?
|
||||
|
|
Loading…
Reference in New Issue