Skip to content

Commit

Permalink
Render: draw dimmed background earlier to match docking code. (#6716)
Browse files Browse the repository at this point in the history
Amend f422e78
  • Loading branch information
ocornut committed Aug 14, 2023
1 parent 8f5ce73 commit ac64b65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ Other changes:
through proper navigation logic: honor scrolling and selection. (#1079, #1131)
- Sliders: Fixed an integer overflow and div-by-zero in SliderInt() when
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
large radius to AddCircle(). (#6657, #5317) [@EggsyCRO, @jdpatdiscord]
- Debug Tools: Metrics: Fixed "Drawlists" section and per-viewport equivalent
Expand Down
8 changes: 4 additions & 4 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5083,6 +5083,10 @@ void ImGui::Render()

CallContextHooks(&g, ImGuiContextHookType_RenderPre);

// Draw modal/window whitening backgrounds
if (first_render_of_frame)
RenderDimmedBackgrounds();

// Add background ImDrawList (for each active viewport)
for (int n = 0; n != g.Viewports.Size; n++)
{
Expand All @@ -5092,10 +5096,6 @@ void ImGui::Render()
AddDrawListToDrawDataEx(&viewport->DrawDataP, viewport->DrawDataBuilder.Layers[0], GetBackgroundDrawList(viewport));
}

// Draw modal/window whitening backgrounds
if (first_render_of_frame)
RenderDimmedBackgrounds();

// Add ImDrawList to render
ImGuiWindow* windows_to_render_top_most[2];
windows_to_render_top_most[0] = (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus)) ? g.NavWindowingTarget->RootWindow : NULL;
Expand Down

0 comments on commit ac64b65

Please sign in to comment.