mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-28 09:30:56 +01:00
IsItemHovered(), IsHovered(): Shallow tweaks, eventually removed all the braces.
This commit is contained in:
parent
2b7d4c713e
commit
eca74d55c7
26
imgui.cpp
26
imgui.cpp
@ -1970,12 +1970,13 @@ bool ImGui::IsItemHovered()
|
|||||||
ImGuiWindow* window = g.CurrentWindow;
|
ImGuiWindow* window = g.CurrentWindow;
|
||||||
if (g.HoveredWindow != window)
|
if (g.HoveredWindow != window)
|
||||||
return false;
|
return false;
|
||||||
if (g.ActiveId == 0 || g.ActiveId == window->DC.LastItemId || g.ActiveIdAllowOverlap || g.ActiveId == window->MoveId)
|
if (g.ActiveId != 0 && g.ActiveId != window->DC.LastItemId && !g.ActiveIdAllowOverlap && g.ActiveId != window->MoveId)
|
||||||
if (IsMouseHoveringRect(window->DC.LastItemRect.Min, window->DC.LastItemRect.Max))
|
return false;
|
||||||
if (IsWindowContentHoverable(window))
|
if (!IsMouseHoveringRect(window->DC.LastItemRect.Min, window->DC.LastItemRect.Max))
|
||||||
return true;
|
return false;
|
||||||
|
if (!IsWindowContentHoverable(window))
|
||||||
return false;
|
return false;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ImGui::IsItemRectHovered()
|
bool ImGui::IsItemRectHovered()
|
||||||
@ -1994,12 +1995,13 @@ bool ImGui::IsHovered(const ImRect& bb, ImGuiID id)
|
|||||||
ImGuiWindow* window = g.CurrentWindow;
|
ImGuiWindow* window = g.CurrentWindow;
|
||||||
if (g.HoveredWindow != window)
|
if (g.HoveredWindow != window)
|
||||||
return false;
|
return false;
|
||||||
if (g.ActiveId == 0 || g.ActiveId == id || g.ActiveIdAllowOverlap)
|
if (g.ActiveId != 0 && g.ActiveId != id && !g.ActiveIdAllowOverlap)
|
||||||
if (IsMouseHoveringRect(bb.Min, bb.Max))
|
return false;
|
||||||
if (IsWindowContentHoverable(g.HoveredRootWindow))
|
if (!IsMouseHoveringRect(bb.Min, bb.Max))
|
||||||
return true;
|
return false;
|
||||||
|
if (!IsWindowContentHoverable(g.HoveredRootWindow))
|
||||||
return false;
|
return false;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ImGui::IsClippedEx(const ImRect& bb, const ImGuiID* id, bool clip_even_when_logged)
|
bool ImGui::IsClippedEx(const ImRect& bb, const ImGuiID* id, bool clip_even_when_logged)
|
||||||
|
Loading…
Reference in New Issue
Block a user