mirror of
https://github.com/stenzek/duckstation.git
synced 2026-11-16 03:00:39 +01:00
ImGuiManager: Ensure DeltaTime can never be negative
This commit is contained in:
1 file changed
+2
-1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user