From 0cd3b5b46e4360b634c00c1f3bae4899b725aac8 Mon Sep 17 00:00:00 2001 From: jupahe64 Date: Tue, 5 Dec 2023 21:34:38 +0100 Subject: [PATCH] fix course select crashes --- Fushigi/ui/modal/PopupModalHost.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Fushigi/ui/modal/PopupModalHost.cs b/Fushigi/ui/modal/PopupModalHost.cs index 90ac0fcb..bcd0c8c8 100644 --- a/Fushigi/ui/modal/PopupModalHost.cs +++ b/Fushigi/ui/modal/PopupModalHost.cs @@ -101,7 +101,7 @@ public void DrawHostedModals() Vector2 center = ImGui.GetMainViewport().GetCenter(); ImGui.SetNextWindowPos(center, ImGuiCond.Always, new Vector2(0.5f, 0.5f)); if(info.MinWindowSize.TryGetValue(out Vector2 minWindowSize)) - ImGui.PushStyleVar(ImGuiStyleVar.WindowMinSize, minWindowSize); + ImGui.SetNextWindowSizeConstraints(minWindowSize, ImGui.GetWindowViewport().Size); if(!shouldClose && !ImGui.IsPopupOpen(info.Id)) ImGui.OpenPopup(info.Id); @@ -110,11 +110,8 @@ public void DrawHostedModals() if (!ImGui.BeginPopupModal(info.Id, ref open, info.WindowFlags)) { methods.Cancel(); - if (info.MinWindowSize is not null) - ImGui.PopStyleVar(); continue; } - ImGui.PopStyleVar(); methods.Execute();