| 5922 | } |
| 5923 | |
| 5924 | static void ImGui::RenderDimmedBackgroundBehindWindow(ImGuiWindow* window, ImU32 col) |
| 5925 | { |
| 5926 | if ((col & IM_COL32_A_MASK) == 0) |
| 5927 | return; |
| 5928 | |
| 5929 | ImGuiViewportP* viewport = (ImGuiViewportP*)GetMainViewport(); |
| 5930 | ImRect viewport_rect = viewport->GetMainRect(); |
| 5931 | |
| 5932 | // Draw behind window by moving the draw command at the FRONT of the draw list |
| 5933 | { |
| 5934 | // We've already called AddWindowToDrawData() which called DrawList->ChannelsMerge() on DockNodeHost windows, |
| 5935 | // and draw list have been trimmed already, hence the explicit recreation of a draw command if missing. |
| 5936 | // 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. |
| 5937 | ImDrawList* draw_list = window->RootWindow->DrawList; |
| 5938 | if (draw_list->CmdBuffer.Size == 0) |
| 5939 | draw_list->AddDrawCmd(); |
| 5940 | draw_list->PushClipRect(viewport_rect.Min - ImVec2(1, 1), viewport_rect.Max + ImVec2(1, 1), false); // FIXME: Need to strictly ensure ImDrawCmd are not merged (ElemCount==6 checks below will verify that) |
| 5941 | draw_list->AddRectFilled(viewport_rect.Min, viewport_rect.Max, col); |
| 5942 | ImDrawCmd cmd = draw_list->CmdBuffer.back(); |
| 5943 | IM_ASSERT(cmd.ElemCount == 6); |
| 5944 | draw_list->CmdBuffer.pop_back(); |
| 5945 | draw_list->CmdBuffer.push_front(cmd); |
| 5946 | draw_list->AddDrawCmd(); // We need to create a command as CmdBuffer.back().IdxOffset won't be correct if we append to same command. |
| 5947 | draw_list->PopClipRect(); |
| 5948 | } |
| 5949 | } |
| 5950 | |
| 5951 | ImGuiWindow* ImGui::FindBottomMostVisibleWindowWithinBeginStack(ImGuiWindow* parent_window) |
| 5952 | { |
nothing calls this directly
no test coverage detected