mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-21 01:44:21 +00:00
DragFloat(): passing min>=max (e.g. 0.0f) for range makes the drag unbound #180, removed extra APIs
This commit is contained in:
parent
61d886e14b
commit
916a8955ec
2 changed files with 5 additions and 15 deletions
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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue