mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-16 16:16:04 -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) {
|
||||
// 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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user