mirror of
https://github.com/ocornut/imgui.git
synced 2026-02-02 03:40:06 +00:00
Merge remote-tracking branch 'origin' into 2015-03-antialiased-primitives
This commit is contained in:
commit
13fab08cdb
4 changed files with 17 additions and 17 deletions
11
imgui.cpp
11
imgui.cpp
|
|
@ -3808,7 +3808,7 @@ bool ImGui::IsRootWindowOrAnyChildFocused()
|
|||
{
|
||||
ImGuiState& g = *GImGui;
|
||||
ImGuiWindow* root_window = GetCurrentWindow()->RootWindow;
|
||||
return g.FocusedWindow->RootWindow == root_window;
|
||||
return g.FocusedWindow && g.FocusedWindow->RootWindow == root_window;
|
||||
}
|
||||
|
||||
float ImGui::GetWindowWidth()
|
||||
|
|
@ -4347,11 +4347,9 @@ static bool IsHovered(const ImRect& bb, ImGuiID id)
|
|||
{
|
||||
ImGuiWindow* window = GetCurrentWindow();
|
||||
if (g.HoveredRootWindow == window->RootWindow)
|
||||
{
|
||||
if ((g.ActiveId == 0 || g.ActiveId == id || g.ActiveIdIsFocusedOnly) && IsMouseHoveringRect(bb))
|
||||
if (IsWindowContentHoverable(g.HoveredRootWindow))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -7215,9 +7213,10 @@ static bool ItemAdd(const ImRect& bb, const ImGuiID* id)
|
|||
// So that clicking on items with no active id such as Text() still returns true with IsItemHovered()
|
||||
window->DC.LastItemHoveredRect = true;
|
||||
window->DC.LastItemHoveredAndUsable = false;
|
||||
if (g.ActiveId == 0 || (id && g.ActiveId == *id) || g.ActiveIdIsFocusedOnly || (g.ActiveId == window->MoveID))
|
||||
if (IsWindowContentHoverable(window))
|
||||
window->DC.LastItemHoveredAndUsable = true;
|
||||
if (g.HoveredRootWindow == window->RootWindow)
|
||||
if (g.ActiveId == 0 || (id && g.ActiveId == *id) || g.ActiveIdIsFocusedOnly || (g.ActiveId == window->MoveID))
|
||||
if (IsWindowContentHoverable(window))
|
||||
window->DC.LastItemHoveredAndUsable = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue