浏览代码

DragFloat() fixed clamping #180

ocornut 10 年之前
父节点
当前提交
750b6c9224
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      imgui.cpp

+ 1 - 1
imgui.cpp

@@ -5531,7 +5531,7 @@ static bool DragScalarBehavior(const ImRect& frame_bb, ImGuiID id, float* v, flo
 
 
                 // Clamp
                 // Clamp
                 if (v_min < v_max)
                 if (v_min < v_max)
-                    g.DragCurrentValue = ImClamp(v_cur, v_min, v_max);
+                    v_cur = ImClamp(v_cur, v_min, v_max);
                 g.DragCurrentValue = v_cur;
                 g.DragCurrentValue = v_cur;
 
 
                 // Round to user desired precision, then apply
                 // Round to user desired precision, then apply