1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-11-25 00:00:40 +01:00

Use fabs() instead of abs() to ensure we use floating point. #164

This commit is contained in:
ocornut 2015-03-19 09:06:34 +00:00
parent 7a2da7cd02
commit 13caf21018

View File

@ -4826,7 +4826,7 @@ static bool SliderBehavior(const ImRect& frame_bb, const ImRect& slider_bb, ImGu
RenderFrame(frame_bb.Min, frame_bb.Max, window->Color(ImGuiCol_FrameBg), true, style.FrameRounding); RenderFrame(frame_bb.Min, frame_bb.Max, window->Color(ImGuiCol_FrameBg), true, style.FrameRounding);
const bool is_finite = (v_min != -FLT_MAX && v_min != FLT_MAX && v_max != -FLT_MAX && v_max != FLT_MAX); const bool is_finite = (v_min != -FLT_MAX && v_min != FLT_MAX && v_max != -FLT_MAX && v_max != FLT_MAX);
const bool is_non_linear = abs(power - 1.0f) > 0.0001f; const bool is_non_linear = fabsf(power - 1.0f) > 0.0001f;
const float slider_sz = horizontal ? slider_bb.GetWidth() : slider_bb.GetHeight(); const float slider_sz = horizontal ? slider_bb.GetWidth() : slider_bb.GetHeight();
float grab_sz; float grab_sz;