瀏覽代碼

Implicit "Debug" window hide itself based on cursor extend instead of the 'Accessed' flag.

ocornut 10 年之前
父節點
當前提交
11025b3160
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      imgui.cpp

+ 3 - 2
imgui.cpp

@@ -2064,8 +2064,9 @@ void ImGui::Render()
     {
     {
         // Hide implicit window if it hasn't been used
         // Hide implicit window if it hasn't been used
         IM_ASSERT(g.CurrentWindowStack.size() == 1);    // Mismatched Begin/End 
         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();
         ImGui::End();
 
 
         // Select window for move/focus when we're done with all our widgets (we use the root window ID here)
         // Select window for move/focus when we're done with all our widgets (we use the root window ID here)