Browse Source

GetCurrentMonitor() - check window center instead of top-left corner (#3468)

Alexandre Almeida 1 year ago
parent
commit
2f6b2897fe
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/platforms/rcore_desktop.c

+ 2 - 0
src/platforms/rcore_desktop.c

@@ -755,6 +755,8 @@ int GetCurrentMonitor(void)
             int y = 0;
             int y = 0;
 
 
             glfwGetWindowPos(platform.handle, &x, &y);
             glfwGetWindowPos(platform.handle, &x, &y);
+            x += (int)CORE.Window.screen.width / 2;
+            y += (int)CORE.Window.screen.height / 2;
 
 
             for (int i = 0; i < monitorCount; i++)
             for (int i = 0; i < monitorCount; i++)
             {
             {