video: Return the display ID when the window is fully enclosed

If the window was fully enclosed, GetDisplayForRect() would return the index of the display ID in the array instead of the display ID itself. Return the display ID itself.
main
Frank Praznik 2023-01-31 12:34:38 -05:00 committed by Sylvain Becker
parent c5f570b30b
commit d58693928d
1 changed files with 1 additions and 1 deletions

View File

@ -1215,7 +1215,7 @@ static SDL_DisplayID GetDisplayForRect(int x, int y, int w, int h)
/* Check if the window is fully enclosed */
if (SDL_GetRectEnclosingPoints(&center, 1, &display_rect, NULL)) {
return i;
return display->id;
}
/* Snap window center to the display rect */