From 4135123a30b3920b6e91005d02d4e06a10a5e006 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 19 May 2024 04:32:40 -0500 Subject: [PATCH] fix modal fade-in issue #1901 --- extern/imgui_patched/imgui.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/extern/imgui_patched/imgui.cpp b/extern/imgui_patched/imgui.cpp index a5f5a293f..de063df0d 100644 --- a/extern/imgui_patched/imgui.cpp +++ b/extern/imgui_patched/imgui.cpp @@ -4940,10 +4940,13 @@ void ImGui::NewFrame() UpdateMouseMovingWindowNewFrame(); // Background darkening/whitening - if (GetTopMostPopupModal() != NULL || (g.NavWindowingTarget != NULL && g.NavWindowingHighlightAlpha > 0.0f)) + if (GetTopMostPopupModal() != NULL || (g.NavWindowingTarget != NULL && g.NavWindowingHighlightAlpha > 0.0f)) { g.DimBgRatio = ImMin(g.DimBgRatio + g.IO.DeltaTime * 6.0f, 1.0f); - else + if (g.DimBgRatio<=0.999f) g.IO.IsSomethingHappening = true; + } else { g.DimBgRatio = ImMax(g.DimBgRatio - g.IO.DeltaTime * 10.0f, 0.0f); + if (g.DimBgRatio>=0.001f) g.IO.IsSomethingHappening = true; + } g.MouseCursor = ImGuiMouseCursor_Arrow; g.WantCaptureMouseNextFrame = g.WantCaptureKeyboardNextFrame = g.WantTextInputNextFrame = -1;