Viewports: Fixed viewport merge code not testing the Minimized flag correctly. (#3118)

This commit is contained in:
omar 2020-04-12 17:48:24 +02:00
parent c142540705
commit 71eb4034eb

View File

@ -10679,7 +10679,11 @@ static bool ImGui::GetWindowAlwaysWantOwnViewport(ImGuiWindow* window)
static bool ImGui::UpdateTryMergeWindowIntoHostViewport(ImGuiWindow* window, ImGuiViewportP* viewport)
{
ImGuiContext& g = *GImGui;
if (!(viewport->Flags & (ImGuiViewportFlags_CanHostOtherWindows | ImGuiViewportFlags_Minimized)) || window->Viewport == viewport)
if (window->Viewport == viewport)
return false;
if ((viewport->Flags & ImGuiViewportFlags_CanHostOtherWindows) == 0)
return false;
if ((viewport->Flags & ImGuiViewportFlags_Minimized) != 0)
return false;
if (!viewport->GetMainRect().Contains(window->Rect()))
return false;