2
0
Эх сурвалжийг харах

Docking: Fixed crash in metrics.

ocornut 5 жил өмнө
parent
commit
600b8f60b4
1 өөрчлөгдсөн 2 нэмэгдсэн , 1 устгасан
  1. 2 1
      imgui.cpp

+ 2 - 1
imgui.cpp

@@ -15687,7 +15687,8 @@ void ImGui::ShowMetricsWindow(bool* p_open)
                 open = ImGui::TreeNode((void*)(intptr_t)node->ID, "%s 0x%04X%s: %s split (vis: '%s')", label, node->ID, node->IsVisible ? "" : " (hidden)", (node->SplitAxis == ImGuiAxis_X) ? "horizontal" : (node->SplitAxis == ImGuiAxis_Y) ? "vertical" : "n/a", node->VisibleWindow ? node->VisibleWindow->Name : "NULL");
                 open = ImGui::TreeNode((void*)(intptr_t)node->ID, "%s 0x%04X%s: %s split (vis: '%s')", label, node->ID, node->IsVisible ? "" : " (hidden)", (node->SplitAxis == ImGuiAxis_X) ? "horizontal" : (node->SplitAxis == ImGuiAxis_Y) ? "vertical" : "n/a", node->VisibleWindow ? node->VisibleWindow->Name : "NULL");
             if (!is_alive) { PopStyleColor(); }
             if (!is_alive) { PopStyleColor(); }
             if (is_active && ImGui::IsItemHovered())
             if (is_active && ImGui::IsItemHovered())
-                GetForegroundDrawList(node->HostWindow ? node->HostWindow : node->VisibleWindow)->AddRect(node->Pos, node->Pos + node->Size, IM_COL32(255, 255, 0, 255));
+                if (ImGuiWindow* window = node->HostWindow ? node->HostWindow : node->VisibleWindow)
+                    GetForegroundDrawList(window)->AddRect(node->Pos, node->Pos + node->Size, IM_COL32(255, 255, 0, 255));
             if (open)
             if (open)
             {
             {
                 IM_ASSERT(node->ChildNodes[0] == NULL || node->ChildNodes[0]->ParentNode == node);
                 IM_ASSERT(node->ChildNodes[0] == NULL || node->ChildNodes[0]->ParentNode == node);