Don't divide by the scale twice

It's already been done in GetUIScreenModeSize(), in the last commit
This commit is contained in:
Sam Lantinga 2023-07-12 15:34:10 -07:00
parent 6aef14fb2d
commit c45a0cd9b3
1 changed files with 4 additions and 5 deletions

View File

@ -135,16 +135,15 @@ static int UIKit_AddSingleDisplayMode(SDL_VideoDisplay *display, int w, int h,
UIScreen *uiscreen, UIScreenMode *uiscreenmode)
{
SDL_DisplayMode mode;
float scale = uiscreen.nativeScale;
SDL_zero(mode);
if (UIKit_AllocateDisplayModeData(&mode, uiscreenmode) < 0) {
return -1;
}
mode.w = w / scale;
mode.h = h / scale;
mode.pixel_density = scale;
mode.w = w;
mode.h = h;
mode.pixel_density = uiscreen.nativeScale;
mode.refresh_rate = UIKit_GetDisplayModeRefreshRate(uiscreen);
mode.format = SDL_PIXELFORMAT_ABGR8888;
@ -189,7 +188,7 @@ static CGSize GetUIScreenModeSize(UIScreen *uiscreen, UIScreenMode *mode)
* https://github.com/libsdl-org/SDL/issues/3220
*/
CGSize size = mode.size;
size.width = SDL_round(size.width / uiscreen.scale);
size.height = SDL_round(size.height / uiscreen.scale);