From 3ec14186cbc09f0a4a5e6709c850919d71138362 Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 18 Feb 2021 14:08:50 +0100 Subject: [PATCH] Viewports: Fix setting of ImGuiViewportFlags_NoRendererClear. (#3213) --- imgui.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 29071b2c..63d23f1a 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -6404,9 +6404,11 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) if (window->WindowClass.ViewportFlagsOverrideClear) viewport_flags &= ~window->WindowClass.ViewportFlagsOverrideClear; - // We also tell the backend that clearing the platform window won't be necessary, as our window is filling the viewport and we have disabled BgAlpha + // We can also tell the backend that clearing the platform window won't be necessary, + // as our window background is filling the viewport and we have disabled BgAlpha. + // FIXME: Work on support for per-viewport transparency (#2766) if (!(flags & ImGuiWindowFlags_NoBackground)) - viewport_flags &= ~ImGuiViewportFlags_NoRendererClear; + viewport_flags |= ImGuiViewportFlags_NoRendererClear; window->Viewport->Flags = viewport_flags; }