mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-06 04:58:47 +02:00
Debug Log: added 'Clipper' events logging.
This commit is contained in:
16
imgui.cpp
16
imgui.cpp
@ -2596,6 +2596,7 @@ void ImGuiListClipper::Begin(int items_count, float items_height)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiWindow* window = g.CurrentWindow;
|
||||
IMGUI_DEBUG_LOG_CLIPPER("Clipper: Begin(%d,%.2f) in '%s'\n", items_count, items_height, window->Name);
|
||||
|
||||
if (ImGuiTable* table = g.CurrentTable)
|
||||
if (table->IsInsideRow)
|
||||
@ -2622,6 +2623,7 @@ void ImGuiListClipper::End()
|
||||
if (ImGuiListClipperData* data = (ImGuiListClipperData*)TempData)
|
||||
{
|
||||
// In theory here we should assert that we are already at the right position, but it seems saner to just seek at the end and not assert/crash the user.
|
||||
IMGUI_DEBUG_LOG_CLIPPER("Clipper: End() in '%s'\n", g.CurrentWindow->Name);
|
||||
if (ItemsCount >= 0 && ItemsCount < INT_MAX && DisplayStart >= 0)
|
||||
ImGuiListClipper_SeekCursorForItem(this, ItemsCount);
|
||||
|
||||
@ -2775,8 +2777,19 @@ static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper)
|
||||
|
||||
bool ImGuiListClipper::Step()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiWindow* window = g.CurrentWindow;
|
||||
bool need_items_height = (ItemsHeight <= 0.0f);
|
||||
bool ret = ImGuiListClipper_StepInternal(this);
|
||||
if (ret == false)
|
||||
if (g.CurrentTable && g.CurrentTable->IsUnfrozenRows == false)
|
||||
IMGUI_DEBUG_LOG_CLIPPER("Clipper: Step(): inside frozen table row.\n");
|
||||
if (need_items_height && ItemsHeight > 0.0f)
|
||||
IMGUI_DEBUG_LOG_CLIPPER("Clipper: Step(): computed ItemsHeight: %.2f.\n", ItemsHeight);
|
||||
if (ret)
|
||||
IMGUI_DEBUG_LOG_CLIPPER("Clipper: Step(): display %d to %d.\n", DisplayStart, DisplayEnd);
|
||||
else
|
||||
IMGUI_DEBUG_LOG_CLIPPER("Clipper: Step(): End.\n");
|
||||
if (!ret)
|
||||
End();
|
||||
return ret;
|
||||
}
|
||||
@ -13278,6 +13291,7 @@ void ImGui::ShowDebugLogWindow(bool* p_open)
|
||||
SameLine(); CheckboxFlags("Focus", &g.DebugLogFlags, ImGuiDebugLogFlags_EventFocus);
|
||||
SameLine(); CheckboxFlags("Popup", &g.DebugLogFlags, ImGuiDebugLogFlags_EventPopup);
|
||||
SameLine(); CheckboxFlags("Nav", &g.DebugLogFlags, ImGuiDebugLogFlags_EventNav);
|
||||
SameLine(); CheckboxFlags("Clipper", &g.DebugLogFlags, ImGuiDebugLogFlags_EventClipper);
|
||||
SameLine(); CheckboxFlags("IO", &g.DebugLogFlags, ImGuiDebugLogFlags_EventIO);
|
||||
|
||||
if (SmallButton("Clear"))
|
||||
|
Reference in New Issue
Block a user