From 4f43b260ccd1e92247d9cc5c819090d36070d084 Mon Sep 17 00:00:00 2001 From: flightlessmango Date: Sun, 14 Apr 2024 09:24:18 +0200 Subject: [PATCH] gamescope frame timing: app was not displaying correctly --- src/hud_elements.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/hud_elements.cpp b/src/hud_elements.cpp index 0e5fed60..9eb3ff6c 100644 --- a/src/hud_elements.cpp +++ b/src/hud_elements.cpp @@ -1085,25 +1085,24 @@ void HudElements::gamescope_frame_timing(){ static double min_time = 0.0f; static double max_time = 50.0f; if (HUDElements.gamescope_debug_app.size() > 0 && HUDElements.gamescope_debug_app.back() > -1){ - ImguiNextColumnFirstItem(); - ImGui::Dummy(ImVec2(0.0f, real_font_size.y)); - ImGui::PushFont(HUDElements.sw_stats->font1); - HUDElements.TextColored(HUDElements.colors.engine, "%s", "App"); - ImGui::TableNextRow(); - ImGui::Dummy(ImVec2(0.0f, real_font_size.y)); auto min = std::min_element(HUDElements.gamescope_debug_app.begin(), HUDElements.gamescope_debug_app.end()); auto max = std::max_element(HUDElements.gamescope_debug_app.begin(), HUDElements.gamescope_debug_app.end()); + + ImGui::PushFont(HUDElements.sw_stats->font1); + ImGui::Dummy(ImVec2(0.0f, real_font_size.y)); + HUDElements.TextColored(HUDElements.colors.engine, "%s", "App"); + ImGui::TableSetColumnIndex(ImGui::TableGetColumnCount() - 1); right_aligned_text(HUDElements.colors.text, HUDElements.ralign_width * 1.3, "min: %.1fms, max: %.1fms", min[0], max[0]); - ImGui::PopFont(); + ImGui::Dummy(ImVec2(0.0f, real_font_size.y / 2)); ImguiNextColumnFirstItem(); + ImGui::PopFont(); char hash[40]; snprintf(hash, sizeof(hash), "##%s", overlay_param_names[OVERLAY_PARAM_ENABLED_frame_timing]); HUDElements.sw_stats->stat_selector = OVERLAY_PLOTS_frame_timing; HUDElements.sw_stats->time_dividor = 1000000.0f; /* ns -> ms */ - ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.0f, 0.0f, 0.0f, 0.0f)); if (ImGui::BeginChild("gamescope_app_window", ImVec2(ImGui::GetWindowContentRegionWidth(), 50))) { ImGui::PlotLines("", HUDElements.gamescope_debug_app.data(),