mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-14 00:34:18 +00:00
Internals: Reintroducing LastActiveIdTimer because it is useful and to reduce merge conflicts. (#1537)
This commit is contained in:
parent
d4b151076c
commit
08e20ae465
2 changed files with 12 additions and 0 deletions
|
|
@ -2115,7 +2115,14 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window)
|
|||
ImGuiContext& g = *GImGui;
|
||||
g.ActiveIdIsJustActivated = (g.ActiveId != id);
|
||||
if (g.ActiveIdIsJustActivated)
|
||||
{
|
||||
g.ActiveIdTimer = 0.0f;
|
||||
if (id != 0)
|
||||
{
|
||||
g.LastActiveId = id;
|
||||
g.LastActiveIdTimer = 0.0f;
|
||||
}
|
||||
}
|
||||
g.ActiveId = id;
|
||||
g.ActiveIdAllowNavDirFlags = 0;
|
||||
g.ActiveIdAllowOverlap = false;
|
||||
|
|
@ -3568,6 +3575,7 @@ void ImGui::NewFrame()
|
|||
ClearActiveID();
|
||||
if (g.ActiveId)
|
||||
g.ActiveIdTimer += g.IO.DeltaTime;
|
||||
g.LastActiveIdTimer += g.IO.DeltaTime;
|
||||
g.ActiveIdPreviousFrame = g.ActiveId;
|
||||
g.ActiveIdIsAlive = false;
|
||||
g.ActiveIdIsJustActivated = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue