Closed NoahStolk closed 6 months ago
you have to enable native debugging in order to figure out what's passed on c++/c side. read https://github.com/ImGuiNET/ImGui.NET#debugging-native-code to figure out how to enable that.
you have to enable native debugging in order to figure out what's passed on c++/c side. read https://github.com/ImGuiNET/ImGui.NET#debugging-native-code to figure out how to enable that.
Thanks, that helps. Debugging the C++ shows the correct values:
But the bug persists. Also, because I'm now using cimgui.dll with debug symbols (compiled using ImGui.NET-nativebuild at tag v1.90), both samples now have the bug:
I didn't realize yesterday that I could query the WindowMinSize
. Doing so gives me 32x32, which seems to be the default value defined in ImGui itself, I think:
Maybe this is a problem with ImGui? It seems really weird that despite WindowMinSize
being set to 32x32, I can't make the window smaller than 200x200, while passing 200x500.
I've also found a workaround; use SetNextWindowSizeConstraints
instead of PushStyleVar(ImGuiStyleVar.WindowMinSize, ...)
:
ImGui.SetNextWindowSizeConstraints(new Vector2(200, 500), new Vector2(float.MaxValue, float.MaxValue));
since correct value is reaching imgui, and its still wrong. I would say reach out to imgui folks and link this issue over there.
oh look what I found https://github.com/ocornut/imgui/issues/7106
also 1.90.1 changelog have this line
Windows: Fixed some auto-resizing path using style.WindowMinSize.x (instead of x/y) for both axises since 1.90. (#7106) [@n0bodysec]
so, going to close the issue. it will be automatically fixed in the next release of imgui.
Describe The Bug
I'm having a very strange bug since version 1.90.0.0.
ImGuiStyleVar.WindowMinSize
does not seem to work correctly anymore. Consider the following calls:This should force the window to not get smaller than 200x500 pixels. Instead, since version 1.90.0.0 it is possible to resize the window to a minimum of 200x200 pixels. You can easily reproduce this bug in
ImGuiNET.SampleProgram.XNA
, but not inImGuiNET.SampleProgram
.ImGuiNET.SampleProgram.XNA:
Similarly, if we swap the values and pass a minimum of 500x200, it is not possible to make the window smaller than 500x500, so the Y value is ignored and X is used for both Vector2 components.
The strange part is that this does work correctly in the other ImGui.NET sample (the non-XNA one).
I've been debugging this bug for a couple hours but am unable to understand where exactly this is going wrong.
I've also made a very simple .NET 8 repo that demonstrates this problem: https://github.com/NoahStolk/WindowMinSize
In this repo you can quickly switch between versions 1.89.x and 1.90.x to see that this used to work correctly in 1.89.x, but not in 1.90.x.
Questions
ImGuiStyleVar
s where you're supposed to passVector2
values?Workaround
Use
ImGui.SetNextWindowSizeConstraints
instead: