Skip to content

Commit

Permalink
Convert iOS to use the new DPI Recalculate
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Feb 20, 2025
1 parent e791e31 commit 361b14b
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions ios/DisplayManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,10 @@ - (void)updateResolution:(UIScreen *)screen {
float diagonal = sqrt(size.height * size.height + size.width * size.width);
dpi = diagonal * scale * 0.1f;
}
g_display.dpi_scale_real = 240.0f / dpi;

g_display.dpi_scale = g_display.dpi_scale_real;
float dpi_scale = 240.0f / dpi;
g_display.Recalculate(size.width * scale, size.height * scale, dpi_scale, 1.0f);

g_display.pixel_xres = size.width * scale;
g_display.pixel_yres = size.height * scale;

g_display.dp_xres = g_display.pixel_xres * g_display.dpi_scale;
g_display.dp_yres = g_display.pixel_yres * g_display.dpi_scale;

g_display.pixel_in_dps = (float)g_display.pixel_xres / (float)g_display.dp_xres;

[[sharedViewController getView] setContentScaleFactor:scale];

// PSP native resize
Expand Down

0 comments on commit 361b14b

Please sign in to comment.