| 17540 | } |
| 17541 | |
| 17542 | static 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 |