From 37ee99983fe94bc292d6c76c35a2bccf45c3d92e Mon Sep 17 00:00:00 2001 From: omar Date: Wed, 24 Jan 2018 15:09:02 +0100 Subject: [PATCH] Clear BgAlphaCond properly after consuming it. Fixes 9a76fd30fd21d0c4f6403b27a235b883ece71f28 (#1567) --- imgui.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/imgui.cpp b/imgui.cpp index a852867b..8d9c1a1d 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -4806,7 +4806,10 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // Window background ImU32 bg_col = GetColorU32(GetWindowBgColorIdxFromFlags(flags)); if (g.NextWindowData.BgAlphaCond != 0) + { bg_col = (bg_col & ~IM_COL32_A_MASK) | (IM_F32_TO_INT8_SAT(g.NextWindowData.BgAlphaVal) << IM_COL32_A_SHIFT); + g.NextWindowData.BgAlphaCond = 0; + } window->DrawList->AddRectFilled(window->Pos+ImVec2(0,window->TitleBarHeight()), window->Pos+window->Size, bg_col, window_rounding, (flags & ImGuiWindowFlags_NoTitleBar) ? ImDrawCornerFlags_All : ImDrawCornerFlags_Bot); // Title bar