From 339554141a2cc810d794df91ef094e664eeb59cb Mon Sep 17 00:00:00 2001 From: PP Date: Fri, 31 Jul 2020 08:38:23 +0800 Subject: [PATCH] Revert "sync view code (#7042)" (#7049) * Revert "sync view code (#7042)" This reverts commit c2b46ae343d484d4e592114f211f6b4100786951. * update --- cocos/core/platform/view.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cocos/core/platform/view.ts b/cocos/core/platform/view.ts index 9948763df9..54e12e472d 100644 --- a/cocos/core/platform/view.ts +++ b/cocos/core/platform/view.ts @@ -834,6 +834,15 @@ export class View extends EventTarget { } } + // hack + private _adjustSizeKeepCanvasSize () { + const designWidth = this._originalDesignResolutionSize.width; + const designHeight = this._originalDesignResolutionSize.height; + if (designWidth > 0) { + this.setDesignResolutionSize(designWidth, designHeight, this._resolutionPolicy); + } + } + private _setViewportMeta (metas, overwrite) { let vp = document.getElementById('cocosMetaElement'); if (vp && overwrite) {