ocornut / imgui

Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
MIT License
60.95k stars 10.29k forks source link

Window autoresize on a single axis #6382

Open arnaud-neny opened 1 year ago

arnaud-neny commented 1 year ago

Version: 1.89.5 Branch: docking

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_win32.cpp + imgui_impl_dx12.cpp Compiler: VS 2022 Operating Windows 10

My Issue/Question:

I am trying to implement some windows that are able to autoresize horizontally but I want to resize these manually on the vertical axis. I have managed to make it work doing this:

My question is: could this modified condition have any side effect (or is it a legit fix)?

dimateos commented 1 year ago

Maybe you could use BeginGroup/EndGroup and then GetItemRectSize to set SetWindowSize. To keep the same Y read it from GetWindowSize or GetWindowHeight. It would be a different solution though.

Did not have any time to test it so just throwing ideas...

arnaud-neny commented 1 year ago

Maybe you could use BeginGroup/EndGroup and then GetItemRectSize to set SetWindowSize. To keep the same Y read it from GetWindowSize or GetWindowHeight. It would be a different solution though.

Did not have any time to test it so just throwing ideas...

The point is to be able to resize the Y axis with the mouse, not within the code.