mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-26 02:34:23 +00:00
Internals: Made IMGUI_DEBUG_LOG redefinable in imconfig.h. Comments. Fix to allow Metrics's NodeWindow() being called with a NULL window.
This commit is contained in:
parent
81b24bd728
commit
efc4c0fe9d
3 changed files with 17 additions and 4 deletions
|
|
@ -5143,6 +5143,7 @@ ImGuiWindow* ImGui::FindWindowByName(const char* name)
|
|||
static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFlags flags)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
//IMGUI_DEBUG_LOG("CreateNewWindow '%s', flags = 0x%08X\n", name, flags);
|
||||
|
||||
// Create window the first time
|
||||
ImGuiWindow* window = IM_NEW(ImGuiWindow)(&g, name);
|
||||
|
|
@ -14571,7 +14572,12 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|||
|
||||
static void NodeWindow(ImGuiWindow* window, const char* label)
|
||||
{
|
||||
if (!ImGui::TreeNode(window, "%s '%s', %d @ 0x%p", label, window->Name, window->Active || window->WasActive, window))
|
||||
if (window == NULL)
|
||||
{
|
||||
ImGui::BulletText("%s: NULL", label);
|
||||
return;
|
||||
}
|
||||
if (!ImGui::TreeNode(window, "%s '%s', %d @ 0x%p", label, window->Name, (window->Active || window->WasActive), window))
|
||||
return;
|
||||
ImGuiWindowFlags flags = window->Flags;
|
||||
NodeDrawList(window, window->Viewport, window->DrawList, "DrawList");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue