MCPcopy Create free account
hub / github.com/Overload-Technologies/Overload / GetPopupAllowedExtentRect

Method GetPopupAllowedExtentRect

Dependencies/ImGui/src/imgui.cpp:13370–13389  ·  view source on GitHub ↗

Note that this is used for popups, which can overlap the non work-area of individual viewports.

Source from the content-addressed store, hash-verified

13368
13369// Note that this is used for popups, which can overlap the non work-area of individual viewports.
13370ImRect 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
13391ImVec2 ImGui::FindBestWindowPosForPopup(ImGuiWindow* window)
13392{

Callers

nothing calls this directly

Calls 5

ImVec2Function · 0.85
GetMainRectMethod · 0.80
GetWidthMethod · 0.80
ExpandMethod · 0.45
GetHeightMethod · 0.45

Tested by

no test coverage detected