You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Internals: Fixed DragInt* default format string. InputScalar(), InputScalarN(), removed InputFloatN(), InputInt(). Note that DragInt2/3/4 will %f format strings will currently be broken. (#320, #643, #708, #1011)
Copy file name to clipboardExpand all lines: CHANGELOG.txt
+1
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,7 @@ Other Changes:
64
64
- DragFloat, SliderFloat: Fixes to allow input of scientific notation numbers when using CTRL+Click to input the value. (~#648, #1011)
65
65
- DragFloat, SliderFloat: Rounding-on-write uses the provided format string instead of parsing the precision from the string, which allows for finer uses of %e %g etc. (#648, #642)
66
66
- DragFloat: Improved computation when using the power curve. Improved lost of input precision with very small steps. Added an assert than power-curve requires a min/max range. (~#642)
67
+
- DragFloat: The 'power' parameter is only honored if the min/max parameter are also setup.
67
68
- Nav: Fixed hovering a Selectable() with the mouse so that it update the navigation cursor (as it happened in the pre 1.60 navigation branch). (#787)
68
69
- Style: Changed default style.DisplaySafeAreaPadding values from (4,4) to (3,3) so it is smaller than FramePadding and has no effect on main menu bar on a computer. (#1439)
69
70
- Misc: Added IMGUI_CHECKVERSION() macro to compare version string and data structure sizes in order to catch issues with mismatching compilation unit settings. (#1695, #1769)
if (op && sscanf(initial_value_buf, scalar_format, &arg0i) < 1)
8572
+
if (op && sscanf(initial_value_buf, format, &arg0i) < 1)
8573
8573
return false;
8574
8574
// Store operand in a float so we can use fractional value for multipliers (*1.1), but constant always parsed as integer so we can fit big integers (e.g. 2000000003) past float precision
8575
8575
if (op == '+') { if (sscanf(buf, "%d", &arg1i)) *v = (int)(arg0i + arg1i); } // Add (use "+-" to subtract)
8576
8576
else if (op == '*') { if (sscanf(buf, "%f", &arg1f)) *v = (int)(arg0i * arg1f); } // Multiply
// FIXME: We don't bother handling support for legacy operators since they are a little too crappy. Instead we may implement a proper expression evaluator in the future.
8584
-
sscanf(buf, scalar_format, data_ptr);
8584
+
sscanf(buf, format, data_ptr);
8585
8585
}
8586
8586
else if (data_type == ImGuiDataType_Float)
8587
8587
{
8588
8588
// For floats we have to ignore format with precision (e.g. "%.2f") because sscanf doesn't take them in
8589
-
scalar_format = "%f";
8589
+
format = "%f";
8590
8590
float* v = (float*)data_ptr;
8591
8591
float arg0f = *v, arg1f = 0.0f;
8592
-
if (op && sscanf(initial_value_buf, scalar_format, &arg0f) < 1)
8592
+
if (op && sscanf(initial_value_buf, format, &arg0f) < 1)
8593
8593
return false;
8594
-
if (sscanf(buf, scalar_format, &arg1f) < 1)
8594
+
if (sscanf(buf, format, &arg1f) < 1)
8595
8595
return false;
8596
8596
if (op == '+') { *v = arg0f + arg1f; } // Add (use "+-" to subtract)
IMGUI_API boolDragInt(constchar* label, int* v, float v_speed = 1.0f, int v_min = 0, int v_max = 0, constchar* format = "%.0f"); // If v_min >= v_max we have no bound
351
-
IMGUI_API boolDragInt2(constchar* label, int v[2], float v_speed = 1.0f, int v_min = 0, int v_max = 0, constchar* format = "%.0f");
352
-
IMGUI_API boolDragInt3(constchar* label, int v[3], float v_speed = 1.0f, int v_min = 0, int v_max = 0, constchar* format = "%.0f");
353
-
IMGUI_API boolDragInt4(constchar* label, int v[4], float v_speed = 1.0f, int v_min = 0, int v_max = 0, constchar* format = "%.0f");
354
-
IMGUI_API boolDragIntRange2(constchar* label, int* v_current_min, int* v_current_max, float v_speed = 1.0f, int v_min = 0, int v_max = 0, constchar* format = "%.0f", constchar* format_max = NULL);
350
+
IMGUI_API boolDragInt(constchar* label, int* v, float v_speed = 1.0f, int v_min = 0, int v_max = 0, constchar* format = "%d"); // If v_min >= v_max we have no bound
351
+
IMGUI_API boolDragInt2(constchar* label, int v[2], float v_speed = 1.0f, int v_min = 0, int v_max = 0, constchar* format = "%d");
352
+
IMGUI_API boolDragInt3(constchar* label, int v[3], float v_speed = 1.0f, int v_min = 0, int v_max = 0, constchar* format = "%d");
353
+
IMGUI_API boolDragInt4(constchar* label, int v[4], float v_speed = 1.0f, int v_min = 0, int v_max = 0, constchar* format = "%d");
354
+
IMGUI_API boolDragIntRange2(constchar* label, int* v_current_min, int* v_current_max, float v_speed = 1.0f, int v_min = 0, int v_max = 0, constchar* format = "%d", constchar* format_max = NULL);
0 commit comments