mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
SliderFloat(): When using keyboard/gamepad and a zero precision format string (e.g. "%.0f"), always step in integer units. (#1866)
This commit is contained in:
parent
b3a5b8debd
commit
929529a0db
2 changed files with 3 additions and 1 deletions
|
|
@ -9112,7 +9112,8 @@ static bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType d
|
|||
else if (delta != 0.0f)
|
||||
{
|
||||
clicked_t = SliderBehaviorCalcRatioFromValue<TYPE,FLOATTYPE>(data_type, *v, v_min, v_max, power, linear_zero_pos);
|
||||
if (is_decimal || is_power)
|
||||
const int decimal_precision = is_decimal ? ImParseFormatPrecision(format, 3) : 0;
|
||||
if ((decimal_precision > 0) || is_power)
|
||||
{
|
||||
delta /= 100.0f; // Gamepad/keyboard tweak speeds in % of slider bounds
|
||||
if (IsNavInputDown(ImGuiNavInput_TweakSlow))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue