Skip to content

Commit 27415cc

Browse files
author
李卓原
committed
fix #150
1 parent cbbfb91 commit 27415cc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/screenutil.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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 / _pixelRatio;
38-
_bottomBarHeight = window.padding.bottom / _pixelRatio;
37+
_statusBarHeight = window.padding.top;
38+
_bottomBarHeight = window.padding.bottom;
3939
_textScaleFactor = window.textScaleFactor;
4040
}
4141

@@ -83,11 +83,11 @@ class ScreenUtil {
8383

8484
/// 状态栏高度 dp 刘海屏会更高
8585
/// The offset from the top
86-
double get statusBarHeight => _statusBarHeight;
86+
double get statusBarHeight => _statusBarHeight / _pixelRatio;
8787

8888
/// 底部安全区距离 dp
8989
/// The offset from the bottom.
90-
double get bottomBarHeight => _bottomBarHeight;
90+
double get bottomBarHeight => _bottomBarHeight / _pixelRatio;
9191

9292
/// 实际的dp与UI设计px的比例
9393
/// The ratio of the actual dp to the design draft px

0 commit comments

Comments
 (0)