Commit 2866a734 authored by alex@thinkpad's avatar alex@thinkpad
Browse files

Menu: fix config var incorrectly changed during fast toggles

(e.g. 36 -> 35 without calling the CBR)

--HG--
branch : config_var_refactor
parent 51f2c7de1d98
......@@ -529,15 +529,16 @@ static void menu_numeric_toggle_R20(int* val, int delta, int min, int max)
int v0 = round_to_R20(v);
if (v0 != v && SGN(v0 - v) == SGN(delta)) // did we round in the correct direction? if so, stop here
{
*val = v0;
return;
v = v0;
goto end;
}
// slow, but works (fast enough for numbers like 5000)
while (v0 == round_to_R20(v))
v += delta;
v = COERCE(round_to_R20(v), min, max);
}
end:
set_config_var_ptr(val, v);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment