mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-11-03 22:51:06 +01:00 
			
		
		
		
	Merge branch 'master' into drag_and_drop
This commit is contained in:
		
							
								
								
									
										11
									
								
								imgui.cpp
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								imgui.cpp
									
									
									
									
									
								
							@@ -1893,6 +1893,8 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window)
 | 
			
		||||
{
 | 
			
		||||
    ImGuiContext& g = *GImGui;
 | 
			
		||||
    g.ActiveIdIsJustActivated = (g.ActiveId != id);
 | 
			
		||||
    if (g.ActiveIdIsJustActivated)
 | 
			
		||||
        g.ActiveIdTimer = 0.0f;
 | 
			
		||||
    g.ActiveId = id;
 | 
			
		||||
    g.ActiveIdAllowOverlap = false;
 | 
			
		||||
    g.ActiveIdIsAlive |= (id != 0);
 | 
			
		||||
@@ -1909,6 +1911,7 @@ void ImGui::SetHoveredID(ImGuiID id)
 | 
			
		||||
    ImGuiContext& g = *GImGui;
 | 
			
		||||
    g.HoveredId = id;
 | 
			
		||||
    g.HoveredIdAllowOverlap = false;
 | 
			
		||||
    g.HoveredIdTimer = (id != 0 && g.HoveredIdPreviousFrame == id) ? (g.HoveredIdTimer + g.IO.DeltaTime) : 0.0f;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ImGui::KeepAliveID(ImGuiID id)
 | 
			
		||||
@@ -2230,11 +2233,15 @@ void ImGui::NewFrame()
 | 
			
		||||
    g.RenderDrawData.CmdListsCount = g.RenderDrawData.TotalVtxCount = g.RenderDrawData.TotalIdxCount = 0;
 | 
			
		||||
 | 
			
		||||
    // Clear reference to active widget if the widget isn't alive anymore
 | 
			
		||||
    if (!g.HoveredIdPreviousFrame)
 | 
			
		||||
        g.HoveredIdTimer = 0.0f;
 | 
			
		||||
    g.HoveredIdPreviousFrame = g.HoveredId;
 | 
			
		||||
    g.HoveredId = 0;
 | 
			
		||||
    g.HoveredIdAllowOverlap = false;
 | 
			
		||||
    if (!g.ActiveIdIsAlive && g.ActiveIdPreviousFrame == g.ActiveId && g.ActiveId != 0)
 | 
			
		||||
        ClearActiveID();
 | 
			
		||||
    if (g.ActiveId)
 | 
			
		||||
        g.ActiveIdTimer += g.IO.DeltaTime;
 | 
			
		||||
    g.ActiveIdPreviousFrame = g.ActiveId;
 | 
			
		||||
    g.ActiveIdIsAlive = false;
 | 
			
		||||
    g.ActiveIdIsJustActivated = false;
 | 
			
		||||
@@ -11033,8 +11040,8 @@ void ImGui::ShowMetricsWindow(bool* p_open)
 | 
			
		||||
        {
 | 
			
		||||
            ImGui::Text("HoveredWindow: '%s'", g.HoveredWindow ? g.HoveredWindow->Name : "NULL");
 | 
			
		||||
            ImGui::Text("HoveredRootWindow: '%s'", g.HoveredRootWindow ? g.HoveredRootWindow->Name : "NULL");
 | 
			
		||||
            ImGui::Text("HoveredId: 0x%08X/0x%08X", g.HoveredId, g.HoveredIdPreviousFrame); // Data is "in-flight" so depending on when the Metrics window is called we may see current frame information or not
 | 
			
		||||
            ImGui::Text("ActiveId: 0x%08X/0x%08X", g.ActiveId, g.ActiveIdPreviousFrame);
 | 
			
		||||
            ImGui::Text("HoveredId: 0x%08X/0x%08X (%.2f sec)", g.HoveredId, g.HoveredIdPreviousFrame, g.HoveredIdTimer); // Data is "in-flight" so depending on when the Metrics window is called we may see current frame information or not
 | 
			
		||||
            ImGui::Text("ActiveId: 0x%08X/0x%08X (%.2f sec)", g.ActiveId, g.ActiveIdPreviousFrame, g.ActiveIdTimer);
 | 
			
		||||
            ImGui::Text("ActiveIdWindow: '%s'", g.ActiveIdWindow ? g.ActiveIdWindow->Name : "NULL");
 | 
			
		||||
            ImGui::Text("NavWindow: '%s'", g.NavWindow ? g.NavWindow->Name : "NULL");
 | 
			
		||||
            ImGui::TreePop();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user