File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed
core/src/main/kotlin/imgui Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -281,6 +281,10 @@ interface demoDebugInformations {
281281 }
282282 unindent()
283283 }
284+
285+ checkbox(" Debug Begin/BeginChild return value" , io::configDebugBeginReturnValueLoop)
286+ sameLine()
287+ metricsHelpMarker(" Some calls to Begin()/BeginChild() will return false.\n\n Will cycle through window depths then repeat. Windows should be flickering while running." )
284288 }
285289
286290 // Windows
Original file line number Diff line number Diff line change @@ -736,6 +736,14 @@ interface windows {
736736 }
737737 }
738738
739+ // [DEBUG] io.ConfigDebugBeginReturnValue override return value to test Begin/End and BeginChild/EndChild behaviors.
740+ // (The implicit fallback window is NOT automatically ended allowing it to always be able to receive commands without crashing)
741+ if (! window.isFallbackWindow && (g.io.configDebugBeginReturnValueOnce && windowJustCreated || g.io.configDebugBeginReturnValueLoop && g.debugBeginReturnValueCullDepth == g.currentWindowStack.size)) {
742+ if (window.autoFitFrames.x > 0 ) window.autoFitFrames.x++
743+ if (window.autoFitFrames.y > 0 ) window.autoFitFrames.y++
744+ return false
745+ }
746+
739747 return ! window.skipItems
740748 }
741749
Original file line number Diff line number Diff line change @@ -67,7 +67,9 @@ fun errorCheckEndFrameSanityChecks() {
6767 // to always call End/EndChild even if Begin/BeginChild returns false! (this is unfortunately inconsistent with most other Begin* API).
6868 if (g.currentWindowStack.size != 1 )
6969 if (g.currentWindowStack.size > 1 ) {
70+ val window = g.currentWindowStack.last().window // <-- This window was not Ended!
7071 assert (g.currentWindowStack.size == 1 ) { " Mismatched Begin/BeginChild vs End/EndChild calls: did you forget to call End/EndChild?" }
72+ // IM_UNUSED(window);
7173 while (g.currentWindowStack.size > 1 )
7274 end()
7375 } else
You can’t perform that action at this time.
0 commit comments