From 460d069626a249331eacf7e19b16d2397b54413b Mon Sep 17 00:00:00 2001 From: jgmdev Date: Tue, 13 Sep 2022 17:11:14 -0400 Subject: [PATCH] removed scale suggestion code since #1115 is a better approach --- src/api/system.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/src/api/system.c b/src/api/system.c index 57060360e..89a99cc52 100644 --- a/src/api/system.c +++ b/src/api/system.c @@ -424,13 +424,11 @@ static int f_get_scale(lua_State *L) { float scale = 1.0; #ifndef __APPLE__ - SDL_DisplayMode dm; + char* env_scale = NULL; + float system_scale = 0; #if _WIN32 float dpi = 0; #endif - char* env_scale = NULL; - float system_scale = 0; - int display_index = SDL_GetWindowDisplayIndex(window); if ( (env_scale = getenv("GDK_SCALE")) != NULL @@ -460,21 +458,6 @@ static int f_get_scale(lua_State *L) { got_initial_scale && (system_scale = sdl_scale_factor()) > 0 ) { scale = system_scale; - /* if all other methods failed use a suggested scale factor */ - } else if (SDL_GetCurrentDisplayMode(display_index, &dm) == 0) { - float base_width = 1280, base_height = 720; - float dmw = (float) dm.w, dmh = (float) dm.h; - if (dmw < dmh) { - base_width = 720; - base_height = 1280; - } - float current_aspect_ratio = dmw / dmh, - base_aspect_ratio = base_width / base_height; - if (current_aspect_ratio >= base_aspect_ratio) { - scale = dmw / base_width; - } else { - scale = dmh / base_height; - } } #endif /* __APPLE__ */ got_initial_scale = true;