mirror of
https://github.com/Tencent/Hippy.git
synced 2026-10-29 14:10:47 +08:00
fix(android): remove add 0.5 from px2dp
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user