Browse Source

SliderInt, SliderFloat: Passing v_min==v_max disable setting value from clicking/dragging (#919)

ocornut 9 năm trước cách đây
mục cha
commit
219e4fb8fb
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      imgui.cpp

+ 1 - 1
imgui.cpp

@@ -6526,7 +6526,7 @@ bool ImGui::SliderBehavior(const ImRect& frame_bb, ImGuiID id, float* v, float v
 
             // Round past decimal precision
             new_value = RoundScalar(new_value, decimal_precision);
-            if (*v != new_value)
+            if (*v != new_value && (v_min != v_max))
             {
                 *v = new_value;
                 value_changed = true;