mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 09:27:00 +00:00
Docking: Fixed rendering of outer decoration happening on non-visible docked window (#2623, #2109). Revealed by 0770449
. We are actually better than before now, as previously those would get unnecessarily get rendered into a hidden draw list.
This commit is contained in:
parent
d3d998a885
commit
07d3083279
@ -6181,11 +6181,15 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
window->DrawList->AddRectFilled(bb.Min, bb.Max, GetColorU32(ImGuiCol_NavWindowingHighlight, g.NavWindowingHighlightAlpha * 0.25f), g.Style.WindowRounding);
|
||||
}
|
||||
|
||||
const bool is_undocked_or_docked_visible = !window->DockIsActive || window->DockTabIsVisible;
|
||||
|
||||
// Since 1.71, child window can render their decoration (bg color, border, scrollbars, etc.) within their parent to save a draw call.
|
||||
// When using overlapping child windows, this will break the assumption that child z-order is mapped to submission order.
|
||||
// We disable this when the parent window has zero vertices, which is a common pattern leading to laying out multiple overlapping child.
|
||||
// We also disabled this when we have dimming overlay behind this specific one child.
|
||||
// FIXME: More code may rely on explicit sorting of overlapping child window and would need to disable this somehow. Please get in contact if you are affected.
|
||||
if (is_undocked_or_docked_visible)
|
||||
{
|
||||
bool render_decorations_in_parent = false;
|
||||
if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Popup) && !window_is_child_tooltip)
|
||||
if (window->DrawList->CmdBuffer.back().ElemCount == 0 && parent_window->DrawList->VtxBuffer.Size > 0)
|
||||
@ -6199,6 +6203,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
|
||||
if (render_decorations_in_parent)
|
||||
window->DrawList = &window->DrawListInst;
|
||||
}
|
||||
|
||||
// Draw navigation selection/windowing rectangle border
|
||||
if (g.NavWindowingTargetAnim == window)
|
||||
|
Loading…
Reference in New Issue
Block a user