mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 03:58:47 +02:00
Nav, Docking: Fix crash on dimming docked window and DockSpaceOverViewport() with PassthruCentralNode.
(amend1dc3af3
,23ef6c1
,657073a
) # Conflicts: # imgui.cpp
This commit is contained in:
@ -4456,7 +4456,11 @@ static void ImGui::RenderDimmedBackgroundBehindWindow(ImGuiWindow* window, ImU32
|
||||
|
||||
// Draw behind window by moving the draw command at the FRONT of the draw list
|
||||
{
|
||||
// We've already called AddWindowToDrawData() which called DrawList->ChannelsMerge() on DockNodeHost windows,
|
||||
// and draw list have been trimmed already, hence the explicit recreation of a draw command if missing.
|
||||
ImDrawList* draw_list = window->RootWindow->DrawList;
|
||||
if (draw_list->CmdBuffer.Size == 0)
|
||||
draw_list->AddDrawCmd();
|
||||
draw_list->PushClipRect(viewport_rect.Min - ImVec2(1, 1), viewport_rect.Max + ImVec2(1, 1), false); // Ensure ImDrawCmd are not merged
|
||||
draw_list->AddRectFilled(viewport_rect.Min, viewport_rect.Max, col);
|
||||
ImDrawCmd cmd = draw_list->CmdBuffer.back();
|
||||
@ -4512,6 +4516,8 @@ static void ImGui::RenderDimmedBackgrounds()
|
||||
bb.Expand(distance);
|
||||
if (bb.GetWidth() >= viewport->Size.x && bb.GetHeight() >= viewport->Size.y)
|
||||
bb.Expand(-distance - 1.0f); // If a window fits the entire viewport, adjust its highlight inward
|
||||
if (window->DrawList->CmdBuffer.Size == 0)
|
||||
window->DrawList->AddDrawCmd();
|
||||
window->DrawList->PushClipRect(viewport->Pos, viewport->Pos + viewport->Size);
|
||||
window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_NavWindowingHighlight, g.NavWindowingHighlightAlpha), window->WindowRounding, 0, 3.0f);
|
||||
window->DrawList->PopClipRect();
|
||||
|
Reference in New Issue
Block a user