提交 a89ec1dd 编写于 作者: C Carl de Billy

fix(android_scaling): Fixed the calculation of the pixel density on Android...

fix(android_scaling): Fixed the calculation of the pixel density on Android when running on device api >= 30
上级 d077eaf8
......@@ -65,8 +65,7 @@ namespace Windows.Graphics.Display
public uint ScreenWidthInRawPixels
=> (uint)_cachedDisplayMetrics.WidthPixels;
public double RawPixelsPerViewPixel
=> 1.0f * (int)_cachedDisplayMetrics.DensityDpi / (int)DisplayMetricsDensity.Default;
public double RawPixelsPerViewPixel => _cachedDisplayMetrics.Density;
public float LogicalDpi
// DisplayMetrics of 1.0 matches 100%, or UWP's default 96.0 DPI.
......@@ -281,7 +280,7 @@ namespace Windows.Graphics.Display
{
Xdpi = configuration.DensityDpi;
Ydpi = configuration.DensityDpi;
Density = configuration.DensityDpi / 160;
Density = configuration.DensityDpi / (float)DisplayMetricsDensity.Default;
ScaledDensity = Density;
DensityDpi = ConvertIntToDensityEnum(configuration.DensityDpi);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册