Android: display_mode scale: cast to do a float division

main
Sylvain 2023-01-27 10:15:08 +01:00 committed by Sam Lantinga
parent fc5f363ff7
commit b23d20cd4d
1 changed files with 2 additions and 2 deletions

View File

@ -122,8 +122,8 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
mDisplay.getRealMetrics( realMetrics ); mDisplay.getRealMetrics( realMetrics );
nDeviceWidth = realMetrics.widthPixels; nDeviceWidth = realMetrics.widthPixels;
nDeviceHeight = realMetrics.heightPixels; nDeviceHeight = realMetrics.heightPixels;
// Use densityDpi instead of density to more closely match what the UI scale is // Use densityDpi instead of density to more closely match what the UI scale is
density = realMetrics.densityDpi / 160; density = (float)realMetrics.densityDpi / 160.0f;
} }
} catch(Exception ignored) { } catch(Exception ignored) {
} }