Render: draw dimmed background earlier to match docking code. (#6716)

Amend f422e78
This commit is contained in:
ocornut 2023-08-14 16:16:39 +02:00
parent 8f5ce73140
commit ac64b65634
2 changed files with 6 additions and 4 deletions

View File

@ -50,6 +50,8 @@ Other changes:
through proper navigation logic: honor scrolling and selection. (#1079, #1131) through proper navigation logic: honor scrolling and selection. (#1079, #1131)
- Sliders: Fixed an integer overflow and div-by-zero in SliderInt() when - Sliders: Fixed an integer overflow and div-by-zero in SliderInt() when
v_max=INT_MAX (#6675, #6679) [@jbarthelmes] v_max=INT_MAX (#6675, #6679) [@jbarthelmes]
- ImDrawData: Fixed an issue where TotalVtxCount/TotalIdxCount does not match the sum
of individual ImDrawList's buffer sizes when a dimming/modal background is rendered. (#6716)
- ImDrawList: Fixed OOB access in _CalcCircleAutoSegmentCount when passing excessively - ImDrawList: Fixed OOB access in _CalcCircleAutoSegmentCount when passing excessively
large radius to AddCircle(). (#6657, #5317) [@EggsyCRO, @jdpatdiscord] large radius to AddCircle(). (#6657, #5317) [@EggsyCRO, @jdpatdiscord]
- Debug Tools: Metrics: Fixed "Drawlists" section and per-viewport equivalent - Debug Tools: Metrics: Fixed "Drawlists" section and per-viewport equivalent

View File

@ -5083,6 +5083,10 @@ void ImGui::Render()
CallContextHooks(&g, ImGuiContextHookType_RenderPre); CallContextHooks(&g, ImGuiContextHookType_RenderPre);
// Draw modal/window whitening backgrounds
if (first_render_of_frame)
RenderDimmedBackgrounds();
// Add background ImDrawList (for each active viewport) // Add background ImDrawList (for each active viewport)
for (int n = 0; n != g.Viewports.Size; n++) for (int n = 0; n != g.Viewports.Size; n++)
{ {
@ -5092,10 +5096,6 @@ void ImGui::Render()
AddDrawListToDrawDataEx(&viewport->DrawDataP, viewport->DrawDataBuilder.Layers[0], GetBackgroundDrawList(viewport)); AddDrawListToDrawDataEx(&viewport->DrawDataP, viewport->DrawDataBuilder.Layers[0], GetBackgroundDrawList(viewport));
} }
// Draw modal/window whitening backgrounds
if (first_render_of_frame)
RenderDimmedBackgrounds();
// Add ImDrawList to render // Add ImDrawList to render
ImGuiWindow* windows_to_render_top_most[2]; ImGuiWindow* windows_to_render_top_most[2];
windows_to_render_top_most[0] = (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus)) ? g.NavWindowingTarget->RootWindow : NULL; windows_to_render_top_most[0] = (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus)) ? g.NavWindowingTarget->RootWindow : NULL;