Skip to content
/ imgui Public
forked from ocornut/imgui

Commit

Permalink
ImDrawList: Automatically calling ChannelsMerge() if not done after a…
Browse files Browse the repository at this point in the history
… split.

Ties fixing f422e78 in docking: iterating root windows was incorrect. Will be faster to lazily merge in RenderDimmedBackground() rather than iterate all.
  • Loading branch information
ocornut committed Aug 30, 2023
1 parent f93d0be commit 08b3a1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Other changes:
- Clipper: Added IncludeItemByIndex() helper to include a single item. (#6424, #3841)
- 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: Automatically calling ChannelsMerge() if not done after a split.
- ImDrawList: Fixed OOB access in _CalcCircleAutoSegmentCount when passing excessively
large radius to AddCircle(). (#6657, #5317) [@EggsyCRO, @jdpatdiscord]
- IO: Exposed io.PlatformLocaleDecimalPoint to configure decimal point ('.' or ',') for
Expand Down
2 changes: 2 additions & 0 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4812,6 +4812,8 @@ static void AddWindowToDrawData(ImGuiWindow* window, int layer)
ImGuiContext& g = *GImGui;
ImGuiViewportP* viewport = g.Viewports[0];
g.IO.MetricsRenderWindows++;
if (window->DrawList->_Splitter._Count > 1)
window->DrawList->ChannelsMerge(); // Merge if user forgot to merge back. Also required in Docking branch for ImGuiWindowFlags_DockNodeHost windows.
ImGui::AddDrawListToDrawDataEx(&viewport->DrawDataP, viewport->DrawDataBuilder.Layers[layer], window->DrawList);
for (ImGuiWindow* child : window->DC.ChildWindows)
if (IsWindowActiveAndVisible(child)) // Clipped children may have been marked not active
Expand Down

0 comments on commit 08b3a1a

Please sign in to comment.