mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-17 08:35:37 -04:00
Update the dp scaling methods
This commit is contained in:
parent
c6cff88133
commit
e67ffe77d0
@ -417,10 +417,13 @@ public final class Tools
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static float dpToPx(float dp) {
|
public static float dpToPx(float dp) {
|
||||||
// 921600 = 1280 * 720, default scale
|
//Better hope for the currentDisplayMetrics to be good
|
||||||
// TODO better way to scaling
|
return dp * currentDisplayMetrics.density;
|
||||||
float scaledDp = dp; // / DisplayMetrics.DENSITY_XHIGH * currentDisplayMetrics.densityDpi;
|
}
|
||||||
return (scaledDp * 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 {
|
public static void copyAssetFile(Context ctx, String fileName, String output, boolean overwrite) throws IOException {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user