mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-27 02:40:05 +00:00
Window: Fix SetNextWindowBgAlpha(1.0f) failing to override alpha component. (#3007)
This commit is contained in:
parent
0a23582718
commit
6e1f8be07b
4 changed files with 8 additions and 3 deletions
|
|
@ -5161,10 +5161,14 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar
|
|||
if (!(flags & ImGuiWindowFlags_NoBackground))
|
||||
{
|
||||
ImU32 bg_col = GetColorU32(GetWindowBgColorIdxFromFlags(flags));
|
||||
bool override_alpha = false;
|
||||
float alpha = 1.0f;
|
||||
if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasBgAlpha)
|
||||
{
|
||||
alpha = g.NextWindowData.BgAlphaVal;
|
||||
if (alpha != 1.0f)
|
||||
override_alpha = true;
|
||||
}
|
||||
if (override_alpha)
|
||||
bg_col = (bg_col & ~IM_COL32_A_MASK) | (IM_F32_TO_INT8_SAT(alpha) << IM_COL32_A_SHIFT);
|
||||
window->DrawList->AddRectFilled(window->Pos + ImVec2(0, window->TitleBarHeight()), window->Pos + window->Size, bg_col, window_rounding, (flags & ImGuiWindowFlags_NoTitleBar) ? ImDrawCornerFlags_All : ImDrawCornerFlags_Bot);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue