diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLSurface.java b/android-project/app/src/main/java/org/libsdl/app/SDLSurface.java index 22c597541..df00053c6 100644 --- a/android-project/app/src/main/java/org/libsdl/app/SDLSurface.java +++ b/android-project/app/src/main/java/org/libsdl/app/SDLSurface.java @@ -122,8 +122,8 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, mDisplay.getRealMetrics( realMetrics ); nDeviceWidth = realMetrics.widthPixels; nDeviceHeight = realMetrics.heightPixels; - // Use densityDpi instead of density to more closely match what the UI scale is - density = realMetrics.densityDpi / 160; + // Use densityDpi instead of density to more closely match what the UI scale is + density = (float)realMetrics.densityDpi / 160.0f; } } catch(Exception ignored) { }