mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 22:53:23 +00:00
Round the window size values when using fixed aspect ratio
This won't get you pixel perfect values, since the exact ratio won't necessarily be whole pixel values, but it will be closer, and matches the logic in the other branch.
This commit is contained in:
parent
3ac28bae6a
commit
4add7e2005
1 changed files with 2 additions and 2 deletions
|
|
@ -1592,11 +1592,11 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
|
|||
switch (edge) {
|
||||
case WMSZ_LEFT:
|
||||
case WMSZ_RIGHT:
|
||||
h = (int)(w / data->window->max_aspect);
|
||||
h = (int)SDL_roundf(w / data->window->max_aspect);
|
||||
break;
|
||||
default:
|
||||
// resizing via corners or top or bottom
|
||||
w = (int)(h*data->window->max_aspect);
|
||||
w = (int)SDL_roundf(h * data->window->max_aspect);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue