mirror of
https://github.com/ocornut/imgui.git
synced 2026-02-05 04:10:07 +00:00
Added assertions and comments for incorrect use/understanding of IsWindowFocused() etc. functions
This commit is contained in:
parent
b13d281356
commit
7f06d385a1
2 changed files with 10 additions and 6 deletions
|
|
@ -5125,25 +5125,29 @@ bool ImGui::IsWindowHovered(ImGuiHoveredFlags flags)
|
|||
bool ImGui::IsWindowFocused()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
IM_ASSERT(g.CurrentWindow); // Not inside a Begin()/End()
|
||||
return g.NavWindow == g.CurrentWindow;
|
||||
}
|
||||
|
||||
bool ImGui::IsRootWindowFocused()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
IM_ASSERT(g.CurrentWindow); // Not inside a Begin()/End()
|
||||
return g.NavWindow == g.CurrentWindow->RootWindow;
|
||||
}
|
||||
|
||||
bool ImGui::IsRootWindowOrAnyChildFocused()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
IM_ASSERT(g.CurrentWindow); // Not inside a Begin()/End()
|
||||
return g.NavWindow && g.NavWindow->RootWindow == g.CurrentWindow->RootWindow;
|
||||
}
|
||||
|
||||
bool ImGui::IsRootWindowOrAnyChildHovered(ImGuiHoveredFlags flags)
|
||||
{
|
||||
IM_ASSERT((flags & ImGuiHoveredFlags_AllowWhenOverlapped) == 0); // Flags not supported by this function
|
||||
ImGuiContext& g = *GImGui;
|
||||
IM_ASSERT((flags & ImGuiHoveredFlags_AllowWhenOverlapped) == 0); // Flags not supported by this function
|
||||
IM_ASSERT(g.CurrentWindow); // Not inside a Begin()/End()
|
||||
if (!g.HoveredRootWindow || (g.HoveredRootWindow != g.CurrentWindow->RootWindow))
|
||||
return false;
|
||||
if (!IsWindowContentHoverable(g.HoveredRootWindow, flags))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue