Note that this is used for popups, which can overlap the non work-area of individual viewports.
| 13368 | |
| 13369 | // Note that this is used for popups, which can overlap the non work-area of individual viewports. |
| 13370 | ImRect ImGui::GetPopupAllowedExtentRect(ImGuiWindow* window) |
| 13371 | { |
| 13372 | ImGuiContext& g = *GImGui; |
| 13373 | ImRect r_screen; |
| 13374 | if (window->ViewportAllowPlatformMonitorExtend >= 0) |
| 13375 | { |
| 13376 | // Extent with be in the frame of reference of the given viewport (so Min is likely to be negative here) |
| 13377 | const ImGuiPlatformMonitor& monitor = g.PlatformIO.Monitors[window->ViewportAllowPlatformMonitorExtend]; |
| 13378 | r_screen.Min = monitor.WorkPos; |
| 13379 | r_screen.Max = monitor.WorkPos + monitor.WorkSize; |
| 13380 | } |
| 13381 | else |
| 13382 | { |
| 13383 | // Use the full viewport area (not work area) for popups |
| 13384 | r_screen = window->Viewport->GetMainRect(); |
| 13385 | } |
| 13386 | ImVec2 padding = g.Style.DisplaySafeAreaPadding; |
| 13387 | r_screen.Expand(ImVec2((r_screen.GetWidth() > padding.x * 2) ? -padding.x : 0.0f, (r_screen.GetHeight() > padding.y * 2) ? -padding.y : 0.0f)); |
| 13388 | return r_screen; |
| 13389 | } |
| 13390 | |
| 13391 | ImVec2 ImGui::FindBestWindowPosForPopup(ImGuiWindow* window) |
| 13392 | { |
nothing calls this directly
no test coverage detected