ImGuiManager: Ensure DeltaTime can never be negative

This commit is contained in:
Stenzek committed 2026-10-25 21:59:36 +10:00
1 parent 0b5b8774cf
commit 296d48a67c
1 file changed
+2 -1
+2 -1
View File
@@ -566,7 +566,8 @@ void ImGuiManager::UpdateScale()
void ImGuiManager::NewFrame(u64 current_time)
{
ImGuiIO& io = ImGui::GetIO();
io.DeltaTime = static_cast<float>(Timer::ConvertValueToSeconds(current_time - s_state.last_render_time));
io.DeltaTime =
std::max(static_cast<float>(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;