From 434aa0435658d1a9c236b08b0ba5e62f064fc60d Mon Sep 17 00:00:00 2001 From: FlightlessMango Date: Tue, 19 May 2020 12:57:17 +0200 Subject: [PATCH] Fixed bench position even more --- src/overlay.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/overlay.cpp b/src/overlay.cpp index dd88d42..3b94e66 100644 --- a/src/overlay.cpp +++ b/src/overlay.cpp @@ -1178,10 +1178,10 @@ void render_mpris_metadata(swapchain_stats& data, const ImVec4& color, metadata& void render_benchmark(swapchain_stats& data, struct overlay_params& params, ImVec2& window_size, unsigned height, uint64_t now){ // TODO, FIX LOG_DURATION FOR BENCHMARK - cout << height - ( 5 * params.font_size + 10.0f + 58) << endl; - ImGui::SetNextWindowSize(ImVec2(window_size.x, 5 * params.font_size + 10.0f + 58), ImGuiCond_Always); - if (height - (window_size.y + data.main_window_pos.y + 5) < 0) - ImGui::SetNextWindowPos(ImVec2(data.main_window_pos.x, data.main_window_pos.y - (5 * params.font_size) - 73), ImGuiCond_Always); + int benchHeight = 5 * params.font_size + 10.0f + 58; + ImGui::SetNextWindowSize(ImVec2(window_size.x, benchHeight), ImGuiCond_Always); + if (height - (window_size.y + data.main_window_pos.y + 5) < benchHeight) + ImGui::SetNextWindowPos(ImVec2(data.main_window_pos.x, data.main_window_pos.y - benchHeight - 5), ImGuiCond_Always); else ImGui::SetNextWindowPos(ImVec2(data.main_window_pos.x, data.main_window_pos.y + window_size.y + 5), ImGuiCond_Always);