Skip to content

Commit f6bd7c8

Browse files
committed
Debug Tools: Item Picker: remove IMGUI_DEBUG_TOOL_ITEM_PICKER_EX since it doesn't work on non-ItemHoverable() items anyway. (ocornut#2673)
Call stack difference not meaningful.
1 parent bc91840 commit f6bd7c8

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

imconfig.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,6 @@
108108
//#define IM_DEBUG_BREAK IM_ASSERT(0)
109109
//#define IM_DEBUG_BREAK __debugbreak()
110110

111-
//---- Debug Tools: Have the Item Picker break in the ItemAdd() function instead of ItemHoverable(),
112-
// (which comes earlier in the code, will catch a few extra items, allow picking items other than Hovered one.)
113-
// This adds a small runtime cost which is why it is not enabled by default.
114-
//#define IMGUI_DEBUG_TOOL_ITEM_PICKER_EX
115-
116111
//---- Debug Tools: Enable slower asserts
117112
//#define IMGUI_DEBUG_PARANOID
118113

imgui.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3716,8 +3716,7 @@ bool ImGui::ItemHoverable(const ImRect& bb, ImGuiID id)
37163716
// [DEBUG] Item Picker tool!
37173717
// We perform the check here because SetHoveredID() is not frequently called (1~ time a frame), making
37183718
// the cost of this tool near-zero. We can get slightly better call-stack and support picking non-hovered
3719-
// items if we perform the test in ItemAdd(), but that would incur a small runtime cost.
3720-
// #define IMGUI_DEBUG_TOOL_ITEM_PICKER_EX in imconfig.h if you want this check to also be performed in ItemAdd().
3719+
// items if we performed the test in ItemAdd(), but that would incur a small runtime cost.
37213720
if (g.DebugItemPickerActive && g.HoveredIdPreviousFrame == id)
37223721
GetForegroundDrawList()->AddRect(bb.Min, bb.Max, IM_COL32(255, 255, 0, 255));
37233722
if (g.DebugItemPickerBreakId == id)
@@ -8646,15 +8645,6 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu
86468645
// Empty identifier are valid and useful in a small amount of cases, but 99.9% of the time you want to use "##something".
86478646
// READ THE FAQ: https://dearimgui.org/faq
86488647
IM_ASSERT(id != window->ID && "Cannot have an empty ID at the root of a window. If you need an empty label, use ## and read the FAQ about how the ID Stack works!");
8649-
8650-
// [DEBUG] Item Picker tool, when enabling the "extended" version we perform the check in ItemAdd()
8651-
#ifdef IMGUI_DEBUG_TOOL_ITEM_PICKER_EX
8652-
if (id == g.DebugItemPickerBreakId)
8653-
{
8654-
IM_DEBUG_BREAK();
8655-
g.DebugItemPickerBreakId = 0;
8656-
}
8657-
#endif
86588648
}
86598649
g.NextItemData.Flags = ImGuiNextItemDataFlags_None;
86608650

@@ -13421,7 +13411,7 @@ void ImGui::DebugNodeWindowsListByBeginStackParent(ImGuiWindow** windows, int wi
1342113411
}
1342213412

1342313413
//-----------------------------------------------------------------------------
13424-
// [SECTION] DEBUG LOG
13414+
// [SECTION] DEBUG LOG WINDOW
1342513415
//-----------------------------------------------------------------------------
1342613416

1342713417
void ImGui::DebugLog(const char* fmt, ...)

0 commit comments

Comments
 (0)