Internals: move chunks of IsItemHovered() so upcoming commit can be less noisy. This commit should be a no-op (check by comparing without white-space changes)

This commit is contained in:
ocornut 2021-11-10 20:17:11 +01:00
parent 2c29e391dd
commit d80a9123b7

View File

@ -3278,9 +3278,11 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags)
{
if ((g.LastItemData.InFlags & ImGuiItemFlags_Disabled) && !(flags & ImGuiHoveredFlags_AllowWhenDisabled))
return false;
return IsItemFocused();
if (!IsItemFocused())
return false;
}
else
{
// Test for bounding box overlap, as updated as ItemAdd()
ImGuiItemStatusFlags status_flags = g.LastItemData.StatusFlags;
if (!(status_flags & ImGuiItemStatusFlags_HoveredRect))
@ -3314,6 +3316,8 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags)
// When the window is collapsed (SkipItems==true) that last item will never be overwritten so we need to detect the case.
if (g.LastItemData.ID == window->MoveId && window->WriteAccessed)
return false;
}
return true;
}