Fix build with IMGUI_DISABLE_DEBUG_TOOLS

This commit is contained in:
ocornut 2022-11-04 16:35:57 +01:00
parent 529cba19b0
commit 44d98bfd6d

View File

@ -6857,12 +6857,16 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
SetLastItemData(window->MoveId, g.CurrentItemFlags, IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max, false) ? ImGuiItemStatusFlags_HoveredRect : 0, title_bar_rect);
// [DEBUG]
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
if (g.DebugLocateId != 0 && (window->ID == g.DebugLocateId || window->MoveId == g.DebugLocateId))
DebugLocateItemResolveWithLastItem();
#endif
// [Test Engine] Register title bar / tab
#ifdef IMGUI_ENABLE_TEST_ENGINE
if (!(window->Flags & ImGuiWindowFlags_NoTitleBar))
IMGUI_TEST_ENGINE_ITEM_ADD(g.LastItemData.Rect, g.LastItemData.ID);
#endif
}
else
{
@ -8697,8 +8701,10 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu
return false;
// [DEBUG]
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
if (id != 0 && id == g.DebugLocateId)
DebugLocateItemResolveWithLastItem();
#endif
//if (g.IO.KeyAlt) window->DrawList->AddRect(bb.Min, bb.Max, IM_COL32(255,255,0,120)); // [DEBUG]
// We need to calculate this now to take account of the current clipping rectangle (as items like Selectable may change them)