From 29f58d987e45eeb54c2401e8a6b6d50dc84fa712 Mon Sep 17 00:00:00 2001 From: Colleague Riley Date: Mon, 8 Jul 2024 12:47:20 -0400 Subject: [PATCH] fix bug with GetCurrentMonitor --- src/platforms/rcore_desktop_rgfw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 603b07ed439f..c488ca8fa719 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -564,16 +564,16 @@ int GetMonitorCount(void) // Get number of monitors int GetCurrentMonitor(void) { - int current = 0; RGFW_monitor *mons = RGFW_getMonitors(); RGFW_monitor mon = RGFW_window_getMonitor(platform.window); for (int i = 0; i < 6; i++) { - if ((mons[i].rect.x == mon.rect.x) && (mons[i].rect.y == mon.rect.y)) current = i; + if ((mons[i].rect.x == mon.rect.x) && (mons[i].rect.y == mon.rect.y)) + return i; } - return current; + return 0; } // Get selected monitor position