From 11025b31604934b825429980fd1414542d8bd7fc Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 19 Mar 2015 15:01:07 +0000 Subject: [PATCH] Implicit "Debug" window hide itself based on cursor extend instead of the 'Accessed' flag. --- imgui.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 84b9a541..96934461 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -2064,8 +2064,9 @@ void ImGui::Render() { // Hide implicit window if it hasn't been used IM_ASSERT(g.CurrentWindowStack.size() == 1); // Mismatched Begin/End - if (g.CurrentWindow && !g.CurrentWindow->Accessed) - g.CurrentWindow->Visible = false; + if (ImGuiWindow* window = g.CurrentWindow) + if (ImLengthSqr(window->DC.CursorMaxPos - window->DC.CursorStartPos) < 0.001f) + g.CurrentWindow->Visible = false; ImGui::End(); // Select window for move/focus when we're done with all our widgets (we use the root window ID here)