Closed ennis closed 5 years ago
Note that i'm not sure that creating a widget outside Begin/End is valid API usage, but it seemed to work fine for other widgets
Thank you @ennis, I confirmed the repro and the bug.
Note that i'm not sure that creating a widget outside Begin/End is valid API usage, but it seemed to work fine for other widget
It is valid api usage, the widgets goes in the fallback "Debug" window that is automatically pushed on the stack. However this issue also happen in regular window.
I have pushed a fix for this issue.
However, this is merely hiding a larger issue, which is that several IsItemXXX functions are not reliable when executed inside a collapsed window. I have some partial-fixes for that in the docking branches but they are not enough, and would like to devise a better fix.
The reason it worked for you within a Begin/End is because you probably tested the return value of Begin (rightly so) and not outputing contents otherwise. In the current API we don't require this test to be done, and if the user submit anything we ignore it. This was initially designed a convenience to be able to call Begin/End without braces. This is effectively causing the Begin/BeginChild/End/EndChild apis to be inconsistent with the other BeginXXX functions and various other issues (to be handled separately).
Closing this as fixed and I took note of the larger bug which I would like to find a solution for.
Version/Branch of Dear ImGui:
Version: 1.69 WIP Branch: master (1d0b4df)
Back-end/Renderer/Compiler/OS
Tested on imgui_impl_dx9.cpp on latest master and on the OpenGL-based renderer of imgui-rs (which uses ImGui 1.66b via cimgui). Compiler: MSVC 2017 OS: Windows 10 x64
Issue:
The following assertion https://github.com/ocornut/imgui/blob/1d0b4df3d95698b117fbe6172f883867f4722422/imgui.cpp#L2716 triggers with this piece of code, when not enclosed in a Begin/End pair (i.e. going in the default "Debug" window):
and doing the following, in order:
Call stack / locals
Minimal example