diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/Tools.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/Tools.java index 4ea68c69e..2896c7743 100644 --- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/Tools.java +++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/Tools.java @@ -417,10 +417,13 @@ public final class Tools } public static float dpToPx(float dp) { - // 921600 = 1280 * 720, default scale - // TODO better way to scaling - float scaledDp = dp; // / DisplayMetrics.DENSITY_XHIGH * currentDisplayMetrics.densityDpi; - return (scaledDp * currentDisplayMetrics.density); + //Better hope for the currentDisplayMetrics to be good + return dp * currentDisplayMetrics.density; + } + + public static float pxToDp(float px){ + //Better hope for the currentDisplayMetrics to be good + return px / currentDisplayMetrics.density; } public static void copyAssetFile(Context ctx, String fileName, String output, boolean overwrite) throws IOException {