diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-20 23:52:49 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-20 23:52:49 +0200 |
commit | 696a8f7279c30e6b8e50cea43317794e949ac466 (patch) | |
tree | ca00662c58c88eb1aa3e42e5d44ca1527a3c7b40 | |
parent | 394f6fedbbafe905bdb10c998b0d2b476a1d710f (diff) |
fix fps draw logic
-rw-r--r-- | main/imgui.cpp | 4 |
1 files 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}); |