From 296d48a67c4ac903c2ffde59bfa3cd645f5b548f Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 25 Oct 2026 21:13:23 +1000 Subject: [PATCH] ImGuiManager: Ensure DeltaTime can never be negative --- src/util/imgui_manager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/imgui_manager.cpp b/src/util/imgui_manager.cpp index 3fa8be4bf..39a7ebf4d 100644 --- a/src/util/imgui_manager.cpp +++ b/src/util/imgui_manager.cpp @@ -566,7 +566,8 @@ void ImGuiManager::UpdateScale() void ImGuiManager::NewFrame(u64 current_time) { ImGuiIO& io = ImGui::GetIO(); - io.DeltaTime = static_cast(Timer::ConvertValueToSeconds(current_time - s_state.last_render_time)); + io.DeltaTime = + std::max(static_cast(Timer::ConvertValueToSeconds(current_time - s_state.last_render_time)), 0.0f); std::tie(s_state.imgui_context->IO.MousePos.x, s_state.imgui_context->IO.MousePos.y) = InputManager::GetPointerAbsolutePosition(0); s_state.last_render_time = current_time;