Browse Source

Nav / Slider: Fixed reaching edge of integer slider with navigation input, bug introduced on January 25 in Nav branch 10a4a77b27. (#787)

pull/1608/head
omar 7 years ago
parent
commit
7b22a91578
  1. 3
      imgui.cpp

3
imgui.cpp

@ -8457,10 +8457,11 @@ bool ImGui::SliderBehavior(const ImRect& frame_bb, ImGuiID id, float* v, float v
} }
if (IsNavInputDown(ImGuiNavInput_PadTweakFast)) if (IsNavInputDown(ImGuiNavInput_PadTweakFast))
delta *= 10.0f; delta *= 10.0f;
clicked_t = ImSaturate(clicked_t + delta);
set_new_value = true; set_new_value = true;
if ((clicked_t >= 1.0f && delta > 0.0f) || (clicked_t <= 0.0f && delta < 0.0f)) // This is to avoid applying the saturation when already past the limits if ((clicked_t >= 1.0f && delta > 0.0f) || (clicked_t <= 0.0f && delta < 0.0f)) // This is to avoid applying the saturation when already past the limits
set_new_value = false; set_new_value = false;
else
clicked_t = ImSaturate(clicked_t + delta);
} }
} }
else else

Loading…
Cancel
Save