From 696a8f7279c30e6b8e50cea43317794e949ac466 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 20 Oct 2022 23:52:49 +0200 Subject: fix fps draw logic --- main/imgui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/imgui.cpp b/main/imgui.cpp index e202fd08..c4c0cd2c 100644 --- a/main/imgui.cpp +++ b/main/imgui.cpp @@ -156,8 +156,8 @@ void app::draw_fps() auto c6 = push_style_color(ImGuiCol_Text, {0, 1, 0, 1}); char buf[16]; - const double dt = _frame_time > 1e-6f ? std::round(1/double(_frame_time)*10.)*.1 + 0.05 : 999; - snprintf(buf, sizeof(buf), "%.1f FPS", dt); + const double hz = _frame_time > 1e-6f ? std::round(1/double(_frame_time)*10.)*.1 + 0.02 : 9999; + snprintf(buf, sizeof(buf), "%.1f FPS", hz); const ImVec2 size = ImGui::CalcTextSize(buf); ImGui::SetNextWindowPos({windowSize()[0] - size.x - 4, 3}); -- cgit v1.2.3