瀏覽代碼

Don't set the display scale if DPI scaling isn't enabled

In this case we want the display mode pixel to screen coordinates to be 1:1 ... but we lose information about the UI scaling of the display - is that okay?
Sam Lantinga 2 年之前
父節點
當前提交
3f0c2a6694
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/video/windows/SDL_windowsmodes.c

+ 1 - 1
src/video/windows/SDL_windowsmodes.c

@@ -182,7 +182,7 @@ static SDL_bool WIN_GetDisplayMode(_THIS, HMONITOR hMonitor, LPCWSTR deviceName,
     mode->pixel_h = data->DeviceMode.dmPelsHeight;
     mode->refresh_rate = WIN_GetRefreshRate(&data->DeviceMode);
 
-    if (index == ENUM_CURRENT_SETTINGS && videodata->GetDpiForMonitor) {
+    if (index == ENUM_CURRENT_SETTINGS && videodata->GetDpiForMonitor && videodata->dpi_scaling_enabled) {
         UINT hdpi_uint, vdpi_uint;
         if (videodata->GetDpiForMonitor(hMonitor, MDT_EFFECTIVE_DPI, &hdpi_uint, &vdpi_uint) == S_OK) {
             mode->display_scale = hdpi_uint / 96.0f;