mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
DragFloat(): passing min>=max (e.g. 0.0f) for range makes the drag unbound #180, removed extra APIs
This commit is contained in:
14
imgui.cpp
14
imgui.cpp
@ -5460,7 +5460,9 @@ static bool DragScalarBehavior(const ImRect& frame_bb, ImGuiID id, float* v, flo
|
||||
step = v_step * g.DragSpeedScaleSlow;
|
||||
|
||||
*v += (mouse_drag_delta.x - g.DragLastMouseDelta.x) * step;
|
||||
*v = ImClamp(*v, v_min, v_max);
|
||||
|
||||
if (v_min < v_max)
|
||||
*v = ImClamp(*v, v_min, v_max);
|
||||
|
||||
g.DragLastMouseDelta.x = mouse_drag_delta.x;
|
||||
value_changed = true;
|
||||
@ -5543,11 +5545,6 @@ bool ImGui::DragFloat(const char* label, float *v, float v_step, float v_min, fl
|
||||
return value_changed;
|
||||
}
|
||||
|
||||
bool ImGui::DragFloat(const char* label, float* v, float v_step, const char* display_format)
|
||||
{
|
||||
return ImGui::DragFloat(label, v, v_step, -FLT_MAX, FLT_MAX, display_format);
|
||||
}
|
||||
|
||||
bool ImGui::DragInt(const char* label, int* v, int v_step, int v_min, int v_max, const char* display_format)
|
||||
{
|
||||
if (!display_format)
|
||||
@ -5558,11 +5555,6 @@ bool ImGui::DragInt(const char* label, int* v, int v_step, int v_min, int v_max,
|
||||
return value_changed;
|
||||
}
|
||||
|
||||
bool ImGui::DragInt(const char* label, int* v, int v_step, const char* display_format)
|
||||
{
|
||||
return ImGui::DragInt(label, v, v_step, IM_INT_MIN, IM_INT_MAX, display_format);
|
||||
}
|
||||
|
||||
enum ImGuiPlotType
|
||||
{
|
||||
ImGuiPlotType_Lines,
|
||||
|
Reference in New Issue
Block a user