Skip to content

Commit 28a4587

Browse files
committed
DragFloat() comment examples, not ready for prime-time #180
1 parent c93f342 commit 28a4587

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

imgui.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -9727,6 +9727,7 @@ void ImGui::ShowTestWindow(bool* opened)
97279727
ImGui::InputFloat3("input float3", vec4a);
97289728
}
97299729

9730+
/*
97309731
{
97319732
static int i1=50;
97329733
static int i2=42;
@@ -9738,6 +9739,7 @@ void ImGui::ShowTestWindow(bool* opened)
97389739
ImGui::DragFloat("drag float", &f1, 1.0f);
97399740
ImGui::DragFloat("drag small float", &f2, 0.0001f, 0.0f, 0.0f, "%.06f");
97409741
}
9742+
*/
97419743

97429744
{
97439745
static int i1=0;

imgui.h

+5-4
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,6 @@ namespace ImGui
300300
IMGUI_API void PlotHistogram(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0), size_t stride = sizeof(float));
301301
IMGUI_API void PlotHistogram(const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0));
302302

303-
// Widgets: Drags (tip: ctrl+click on a drag box to input text)
304-
IMGUI_API bool DragFloat(const char* label, float* v, float v_step = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f"); // If v_max >= v_max we have no bound
305-
IMGUI_API bool DragInt(const char* label, int* v, int v_step = 1, int v_min = 0.0f, int v_max = 0.0f, const char* display_format = "%.0f"); // If v_max >= v_max we have no bound
306-
307303
// Widgets: Sliders (tip: ctrl+click on a slider to input text)
308304
IMGUI_API bool SliderFloat(const char* label, float* v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f); // adjust display_format to decorate the value with a prefix or a suffix. Use power!=1.0 for logarithmic sliders
309305
IMGUI_API bool SliderFloat2(const char* label, float v[2], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
@@ -317,6 +313,11 @@ namespace ImGui
317313
IMGUI_API bool VSliderFloat(const char* label, const ImVec2& size, float* v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
318314
IMGUI_API bool VSliderInt(const char* label, const ImVec2& size, int* v, int v_min, int v_max, const char* display_format = "%.0f");
319315

316+
// Widgets: Drags (tip: ctrl+click on a drag box to input text)
317+
// ImGui 1.38+ work-in-progress, may change name or API.
318+
IMGUI_API bool DragFloat(const char* label, float* v, float v_step = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f"); // If v_max >= v_max we have no bound
319+
IMGUI_API bool DragInt(const char* label, int* v, int v_step = 1, int v_min = 0.0f, int v_max = 0.0f, const char* display_format = "%.0f"); // If v_max >= v_max we have no bound
320+
320321
// Widgets: Input
321322
IMGUI_API bool InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags = 0, ImGuiTextEditCallback callback = NULL, void* user_data = NULL);
322323
IMGUI_API bool InputFloat(const char* label, float* v, float step = 0.0f, float step_fast = 0.0f, int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0);

0 commit comments

Comments
 (0)