File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed
framework/ohos/src/main/ets/support/utils Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -33,11 +33,6 @@ export class DimensionsUtil {
3333 private static SHOW_NAV_BAR_RES_NAME = "config_showNavigationBar";
3434 private static NAVIGATE_BAR_HEIGHT = 0;
3535
36- static async getLastWindowRect(context: Context): Promise<window.Rect> {
37- const windowObj = await window.getLastWindow(context);
38- return windowObj.getWindowProperties().windowRect;
39- }
40-
4136 static async getDimensions(ww: number, wh: number, context: Context): Promise<HippyMap> {
4237 let displayClass: display.Display = display.getDefaultDisplaySync();
4338 await DimensionsUtil.getStatusBarHeight(displayClass);
@@ -47,14 +42,8 @@ export class DimensionsUtil {
4742 let whPixels = wh * displayClass.densityPixels;
4843
4944 if (wwPixels < 0 || whPixels < 0) {
50- let windowRect = await DimensionsUtil.getLastWindowRect(context);
51- if (windowRect.width > 0 && windowRect.height > 0) {
52- wwPixels = windowRect.width;
53- whPixels = windowRect.height;
54- } else {
55- wwPixels = displayClass.width;
56- whPixels = displayClass.height;
57- }
45+ wwPixels = displayClass.width;
46+ whPixels = displayClass.height;
5847 }
5948
6049 let windowDisplayMetricsMap = new Map<string, HippyValue>()
You can’t perform that action at this time.
0 commit comments