mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02: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:
@ -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))
|
||||
|
Reference in New Issue
Block a user