Browse Source

ImDrawData: Fixed an issue where TotalVtxCount/TotalIdxCount does not match the sum of individual ImDrawList's buffer sizes. (#6716)

Amend dbeeeae59
pull/3653/merge
ocornut 1 year ago
parent
commit
f422e7826f
  1. 2
      docs/CHANGELOG.txt
  2. 17
      imgui.cpp

2
docs/CHANGELOG.txt

@ -48,6 +48,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

17
imgui.cpp

@ -5011,8 +5011,6 @@ static void AddWindowToDrawData(ImGuiWindow* window, int layer)
ImGuiViewportP* viewport = window->Viewport;
IM_ASSERT(viewport != NULL);
g.IO.MetricsRenderWindows++;
if (window->Flags & ImGuiWindowFlags_DockNodeHost)
window->DrawList->ChannelsMerge();
ImGui::AddDrawListToDrawDataEx(&viewport->DrawDataP, viewport->DrawDataBuilder.Layers[layer], window->DrawList);
for (int i = 0; i < window->DC.ChildWindows.Size; i++)
{
@ -5349,6 +5347,17 @@ void ImGui::Render()
AddDrawListToDrawDataEx(&viewport->DrawDataP, viewport->DrawDataBuilder.Layers[0], GetBackgroundDrawList(viewport));
}
for (int n = 0; n != g.WindowsFocusOrder.Size; n++)
{
ImGuiWindow* window = g.Windows[n];
if (window->Flags & ImGuiWindowFlags_DockNodeHost)
window->DrawList->ChannelsMerge();
}
// 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->RootWindowDockTree : NULL;
@ -5364,10 +5373,6 @@ void ImGui::Render()
if (windows_to_render_top_most[n] && IsWindowActiveAndVisible(windows_to_render_top_most[n])) // NavWindowingTarget is always temporarily displayed as the top-most window
AddRootWindowToDrawData(windows_to_render_top_most[n]);
// Draw modal/window whitening backgrounds
if (first_render_of_frame)
RenderDimmedBackgrounds();
// Draw software mouse cursor if requested by io.MouseDrawCursor flag
if (g.IO.MouseDrawCursor && first_render_of_frame && g.MouseCursor != ImGuiMouseCursor_None)
RenderMouseCursor(g.IO.MousePos, g.Style.MouseCursorScale, g.MouseCursor, IM_COL32_WHITE, IM_COL32_BLACK, IM_COL32(0, 0, 0, 48));

Loading…
Cancel
Save