瀏覽代碼

Revert "Internals: Added LastActiveId, LastActiveIdTimer. (#1537)" Will come up with a better design later.
This reverts commit 007f4034c907defdf781a1d34ad1f769b0374436.

omar 7 年之前
父節點
當前提交
95b773370f
共有 2 個文件被更改,包括 0 次插入12 次删除
  1. 0 8
      imgui.cpp
  2. 0 4
      imgui_internal.h

+ 0 - 8
imgui.cpp

@@ -1929,14 +1929,7 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window)
     ImGuiContext& g = *GImGui;
     ImGuiContext& g = *GImGui;
     g.ActiveIdIsJustActivated = (g.ActiveId != id);
     g.ActiveIdIsJustActivated = (g.ActiveId != id);
     if (g.ActiveIdIsJustActivated)
     if (g.ActiveIdIsJustActivated)
-    {
         g.ActiveIdTimer = 0.0f;
         g.ActiveIdTimer = 0.0f;
-        if (id != 0)
-        {
-            g.LastActiveId = id;
-            g.LastActiveIdTimer = 0.0f;
-        }
-    }
     g.ActiveId = id;
     g.ActiveId = id;
     g.ActiveIdAllowOverlap = false;
     g.ActiveIdAllowOverlap = false;
     g.ActiveIdIsAlive |= (id != 0);
     g.ActiveIdIsAlive |= (id != 0);
@@ -2315,7 +2308,6 @@ void ImGui::NewFrame()
         ClearActiveID();
         ClearActiveID();
     if (g.ActiveId)
     if (g.ActiveId)
         g.ActiveIdTimer += g.IO.DeltaTime;
         g.ActiveIdTimer += g.IO.DeltaTime;
-    g.LastActiveIdTimer += g.IO.DeltaTime;
     g.ActiveIdPreviousFrame = g.ActiveId;
     g.ActiveIdPreviousFrame = g.ActiveId;
     g.ActiveIdIsAlive = false;
     g.ActiveIdIsAlive = false;
     g.ActiveIdIsJustActivated = false;
     g.ActiveIdIsJustActivated = false;

+ 0 - 4
imgui_internal.h

@@ -533,8 +533,6 @@ struct ImGuiContext
     bool                    ActiveIdAllowOverlap;               // Active widget allows another widget to steal active id (generally for overlapping widgets, but not always)
     bool                    ActiveIdAllowOverlap;               // Active widget allows another widget to steal active id (generally for overlapping widgets, but not always)
     ImVec2                  ActiveIdClickOffset;                // Clicked offset from upper-left corner, if applicable (currently only set by ButtonBehavior)
     ImVec2                  ActiveIdClickOffset;                // Clicked offset from upper-left corner, if applicable (currently only set by ButtonBehavior)
     ImGuiWindow*            ActiveIdWindow;
     ImGuiWindow*            ActiveIdWindow;
-    ImGuiID                 LastActiveId;                       // Store the last non-zero ActiveID, useful for animation.
-    float                   LastActiveIdTimer;
     ImGuiWindow*            MovingWindow;                       // Track the child window we clicked on to move a window.
     ImGuiWindow*            MovingWindow;                       // Track the child window we clicked on to move a window.
     ImGuiID                 MovingWindowMoveId;                 // == MovingWindow->MoveId
     ImGuiID                 MovingWindowMoveId;                 // == MovingWindow->MoveId
     ImVector<ImGuiColMod>   ColorModifiers;                     // Stack for PushStyleColor()/PopStyleColor()
     ImVector<ImGuiColMod>   ColorModifiers;                     // Stack for PushStyleColor()/PopStyleColor()
@@ -631,8 +629,6 @@ struct ImGuiContext
         ActiveIdAllowOverlap = false;
         ActiveIdAllowOverlap = false;
         ActiveIdClickOffset = ImVec2(-1,-1);
         ActiveIdClickOffset = ImVec2(-1,-1);
         ActiveIdWindow = NULL;
         ActiveIdWindow = NULL;
-        LastActiveId = 0;
-        LastActiveIdTimer = 0.0f;
         MovingWindow = NULL;
         MovingWindow = NULL;
         MovingWindowMoveId = 0;
         MovingWindowMoveId = 0;