From 0420ab027e7b3a876e8999bde7a94212d1c37463 Mon Sep 17 00:00:00 2001 From: ocornut Date: Fri, 16 Sep 2016 01:09:57 +0200 Subject: [PATCH] Metrics: Displaying window position + moving extraneous line in IsPopupOpen(). --- imgui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 65788592..bdd08a30 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3356,8 +3356,7 @@ void ImGui::EndTooltip() static bool IsPopupOpen(ImGuiID id) { ImGuiContext& g = *GImGui; - const bool is_open = g.OpenPopupStack.Size > g.CurrentPopupStack.Size && g.OpenPopupStack[g.CurrentPopupStack.Size].PopupId == id; - return is_open; + return g.OpenPopupStack.Size > g.CurrentPopupStack.Size && g.OpenPopupStack[g.CurrentPopupStack.Size].PopupId == id; } // Mark popup as open (toggle toward open state). @@ -9728,6 +9727,7 @@ void ImGui::ShowMetricsWindow(bool* p_open) if (!ImGui::TreeNode(window, "%s '%s', %d @ 0x%p", label, window->Name, window->Active || window->WasActive, window)) return; NodeDrawList(window->DrawList, "DrawList"); + ImGui::BulletText("Pos: (%.1f,%.1f)", window->Pos.x, window->Pos.y); ImGui::BulletText("Size: (%.1f,%.1f), SizeContents (%.1f,%.1f)", window->Size.x, window->Size.y, window->SizeContents.x, window->SizeContents.y); ImGui::BulletText("Scroll: (%.2f,%.2f)", window->Scroll.x, window->Scroll.y); if (window->RootWindow != window) NodeWindow(window->RootWindow, "RootWindow");