fix(android): remove add 0.5 from px2dp

This commit is contained in:
maxli
2021-09-14 11:24:42 +08:00
committed by siguangli
parent 8f9d7f0b99
commit 8f0254a688
@@ -41,7 +41,7 @@ public class PixelUtil {
}
public static float px2dp(float value) {
return value / getMetrics().density + 0.5f;
return value / getMetrics().density;
}
public static float sp2px(float value) {
@@ -49,7 +49,7 @@ public class PixelUtil {
}
public static float px2sp(float value) {
return value / getMetrics().scaledDensity + 0.5f;
return value / getMetrics().scaledDensity;
}
public static float getDensity() {