@@ -34,8 +34,8 @@ class ScreenUtil {
3434 _pixelRatio = window.devicePixelRatio;
3535 _screenWidth = window.physicalSize.width / _pixelRatio;
3636 _screenHeight = window.physicalSize.height / _pixelRatio;
37- _statusBarHeight = window.padding.top;
38- _bottomBarHeight = window.padding.bottom;
37+ _statusBarHeight = window.padding.top / _pixelRatio ;
38+ _bottomBarHeight = window.padding.bottom / _pixelRatio ;
3939 _textScaleFactor = window.textScaleFactor;
4040 }
4141
@@ -119,12 +119,9 @@ class ScreenUtil {
119119 ///Font size adaptation method
120120 ///@param [fontSize] The size of the font on the UI design, in px.
121121 ///@param [allowFontScaling]
122- num setSp (num fontSize, {bool allowFontScalingSelf}) =>
123- allowFontScalingSelf == null
124- ? (allowFontScaling
125- ? (fontSize * scaleText)
126- : ((fontSize * scaleText) / _textScaleFactor))
127- : (allowFontScalingSelf
128- ? (fontSize * scaleText)
129- : ((fontSize * scaleText) / _textScaleFactor));
122+ num setSp (num fontSize, {bool allowFontScalingSelf}) => allowFontScalingSelf == null
123+ ? (allowFontScaling ? (fontSize * scaleText) : ((fontSize * scaleText) / _textScaleFactor))
124+ : (allowFontScalingSelf
125+ ? (fontSize * scaleText)
126+ : ((fontSize * scaleText) / _textScaleFactor));
130127}
0 commit comments