Skip to content

Commit a5cc2e4

Browse files
committed
Fixed InputInt() writing to output when it doesn't need to, which break with large int due to int<>float conversions. Added todo note.
1 parent 6b16424 commit a5cc2e4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

imgui.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@
201201
- main: make IsHovered() info stored in a stack? so that 'if TreeNode() { Text; TreePop; } if IsHovered' return the hover state of the TreeNode?
202202
- scrollbar: use relative mouse movement when first-clicking inside of scroll grab box.
203203
- scrollbar: make the grab visible and a minimum size for long scroll regions
204-
- input number: optional range min/max
204+
!- input number: very large int not reliably supported because of int<>float conversions.
205+
- input number: optional range min/max for Input*() functions
205206
- input number: holding [-]/[+] buttons should increase the step non-linearly
206207
- input number: use mouse wheel to step up/down
207208
- layout: clean up the InputFloatN/SliderFloatN/ColorEdit4 horrible layout code. item width should include frame padding, then we can have a generic horizontal layout helper.
@@ -4341,7 +4342,8 @@ bool ImGui::InputInt(const char* label, int *v, int step, int step_fast, ImGuiIn
43414342
{
43424343
float f = (float)*v;
43434344
const bool value_changed = ImGui::InputFloat(label, &f, (float)step, (float)step_fast, 0, extra_flags);
4344-
*v = (int)f;
4345+
if (value_changed)
4346+
*v = (int)f;
43454347
return value_changed;
43464348
}
43474349

0 commit comments

Comments
 (0)