@@ -34,8 +34,8 @@ class ScreenUtil {
34
34
_pixelRatio = window.devicePixelRatio;
35
35
_screenWidth = window.physicalSize.width / _pixelRatio;
36
36
_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 ;
39
39
_textScaleFactor = window.textScaleFactor;
40
40
}
41
41
@@ -119,12 +119,9 @@ class ScreenUtil {
119
119
///Font size adaptation method
120
120
///@param [fontSize] The size of the font on the UI design, in px.
121
121
///@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));
130
127
}
0 commit comments