| 5732 | } |
| 5733 | |
| 5734 | static void ImGui::RenderDimmedBackgroundBehindWindow(ImGuiWindow* window, ImU32 col) |
| 5735 | { |
| 5736 | if ((col & IM_COL32_A_MASK) == 0) |
| 5737 | return; |
| 5738 | |
| 5739 | ImGuiViewportP* viewport = (ImGuiViewportP*)GetMainViewport(); |
| 5740 | ImRect viewport_rect = viewport->GetMainRect(); |
| 5741 | |
| 5742 | // Draw behind window by moving the draw command at the FRONT of the draw list |
| 5743 | { |
| 5744 | // We've already called AddWindowToDrawData() which called DrawList->ChannelsMerge() on DockNodeHost windows, |
| 5745 | // and draw list have been trimmed already, hence the explicit recreation of a draw command if missing. |
| 5746 | // FIXME: This is creating complication, might be simpler if we could inject a drawlist in drawdata at a given position and not attempt to manipulate ImDrawCmd order. |
| 5747 | ImDrawList* draw_list = window->RootWindow->DrawList; |
| 5748 | if (draw_list->CmdBuffer.Size == 0) |
| 5749 | draw_list->AddDrawCmd(); |
| 5750 | draw_list->PushClipRect(viewport_rect.Min - ImVec2(1, 1), viewport_rect.Max + ImVec2(1, 1), false); // FIXME: Need to stricty ensure ImDrawCmd are not merged (ElemCount==6 checks below will verify that) |
| 5751 | draw_list->AddRectFilled(viewport_rect.Min, viewport_rect.Max, col); |
| 5752 | ImDrawCmd cmd = draw_list->CmdBuffer.back(); |
| 5753 | IM_ASSERT(cmd.ElemCount == 6); |
| 5754 | draw_list->CmdBuffer.pop_back(); |
| 5755 | draw_list->CmdBuffer.push_front(cmd); |
| 5756 | draw_list->AddDrawCmd(); // We need to create a command as CmdBuffer.back().IdxOffset won't be correct if we append to same command. |
| 5757 | draw_list->PopClipRect(); |
| 5758 | } |
| 5759 | } |
| 5760 | |
| 5761 | ImGuiWindow* ImGui::FindBottomMostVisibleWindowWithinBeginStack(ImGuiWindow* parent_window) |
| 5762 | { |
nothing calls this directly
no test coverage detected