From d953f8d99a25479346d7133b658fa0f66eb4f6d5 Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 19 Mar 2015 14:49:58 +0000 Subject: [PATCH] ShowTestWindow: Graph checkbox under the label, also demo using BeginGroup/EndGroup() --- imgui.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 37721c82..84b9a541 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -9433,9 +9433,12 @@ void ImGui::ShowTestWindow(bool* opened) phase += 0.10f*values_offset; } } - ImGui::PlotLines("Frame Times", &values.front(), (int)values.size(), (int)values_offset, "avg 0.0", -1.0f, 1.0f, ImVec2(0,80)); - - ImGui::SameLine(); ImGui::Checkbox("pause", &pause); + ImGui::PlotLines("##Graph", &values.front(), (int)values.size(), (int)values_offset, "avg 0.0", -1.0f, 1.0f, ImVec2(0,80)); + ImGui::SameLine(0, (int)ImGui::GetStyle().ItemInnerSpacing.x); + ImGui::BeginGroup(); + ImGui::Text("Graph"); + ImGui::Checkbox("pause", &pause); + ImGui::EndGroup(); ImGui::PlotHistogram("Histogram", arr, IM_ARRAYSIZE(arr), 0, NULL, 0.0f, 1.0f, ImVec2(0,80)); }