Skip to content

Commit

Permalink
Fix build with IMGUI_DISABLE_DEBUG_TOOLS
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut authored and kjblanchard committed May 5, 2023
1 parent d16d5cc commit 46b04e2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 46b04e2

Please sign in to comment.