MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / FindPlatformMonitorForPos

Method FindPlatformMonitorForPos

imgui_tiny_app/imgui/imgui.cpp:17542–17552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17540}
17541
17542static int ImGui::FindPlatformMonitorForPos(const ImVec2& pos)
17543{
17544 ImGuiContext& g = *GImGui;
17545 for (int monitor_n = 0; monitor_n < g.PlatformIO.Monitors.Size; monitor_n++)
17546 {
17547 const ImGuiPlatformMonitor& monitor = g.PlatformIO.Monitors[monitor_n];
17548 if (ImRect(monitor.MainPos, monitor.MainPos + monitor.MainSize).Contains(pos))
17549 return monitor_n;
17550 }
17551 return -1;
17552}
17553
17554// Search for the monitor with the largest intersection area with the given rectangle
17555// We generally try to avoid searching loops but the monitor count should be very small here

Callers

nothing calls this directly

Calls 2

ImRectFunction · 0.70
ContainsMethod · 0.45

Tested by

no test coverage detected