ocornut / imgui

Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
MIT License
61.11k stars 10.3k forks source link

SetNextWindowBgAlpha(1.0) works incorrectly #3007

Closed Albog closed 4 years ago

Albog commented 4 years ago

Version/Branch of Dear ImGui: Version: 1.74 Branch: master

Back-end/Renderer/Compiler/OS Back-ends: imgui_impl_dx12.cpp + imgui_impl_win32.cpp Compiler: MSVC 2015 VC++ , platform toolset 140 Operating System: win10, x64

My Issue/Question: As far as I understand, SetNextWindowBgAlpha(1.0) works incorrectly. It looks like this (lower window is foreground with SetNextWindowBgAlpha(1.0) image

The correct one should be like this: image

Imgui code uses value from GetColorU32(GetWindowBgColorIdxFromFlags(flags)) instead of 1.0 that come from SetNextWindowBgAlpha. So, the 'alpha' part of the RenderWindowDecorations() is probably wrong:

Original code (ImGui 1.74) image Proposed fix: image

ocornut commented 4 years ago

Thank you! The reason it was written this way is that the Docking branch has additional code altering the alpha value. I will apply the fix in Master right now and will figure out a fix for Docking separately.