Przeglądaj źródła

Removed 'Accessed' flag from ImGuiWindow so GetCurrentWindow() compiles to a simpler accessor

ocornut 10 lat temu
rodzic
commit
129339adb0
1 zmienionych plików z 0 dodań i 8 usunięć
  1. 0 8
      imgui.cpp

+ 0 - 8
imgui.cpp

@@ -1169,7 +1169,6 @@ struct ImGuiWindow
     float                   NextScrollY;
     bool                    ScrollbarY;
     bool                    Visible;                            // Set to true on Begin()
-    bool                    Accessed;                           // Set to true when any widget access the current window
     bool                    Collapsed;                          // Set when collapsing window to become only title-bar
     bool                    SkipItems;                          // == Visible && !Collapsed
     int                     AutoFitFrames;
@@ -1223,7 +1222,6 @@ static inline ImGuiWindow* GetCurrentWindow()
 {
     ImGuiState& g = *GImGui;
     IM_ASSERT(g.CurrentWindow != NULL);    // ImGui::NewFrame() hasn't been called yet?
-    g.CurrentWindow->Accessed = true;
     return g.CurrentWindow;
 }
 
@@ -1512,7 +1510,6 @@ ImGuiWindow::ImGuiWindow(const char* name)
     NextScrollY = 0.0f;
     ScrollbarY = false;
     Visible = false;
-    Accessed = false;
     Collapsed = false;
     SkipItems = false;
     AutoFitFrames = -1;
@@ -1937,7 +1934,6 @@ void ImGui::NewFrame()
     {
         ImGuiWindow* window = g.Windows[i];
         window->Visible = false;
-        window->Accessed = false;
     }
 
     // No window should be open at the beginning of the frame.
@@ -3189,10 +3185,6 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size, float bg
         clip_rect.z -= style.ScrollbarWidth;
     PushClipRect(clip_rect);
 
-    // Clear 'accessed' flag last thing
-    if (first_begin_of_the_frame)
-        window->Accessed = false;
-
     // Child window can be out of sight and have "negative" clip windows.
     // Mark them as collapsed so commands are skipped earlier (we can't manually collapse because they have no title bar).
     if (flags & ImGuiWindowFlags_ChildWindow)