Add a check that windowId is 0 by default (#14159)

This commit is contained in:
qiuguohua
2023-02-09 16:07:31 +08:00
committed by GitHub
parent 9ca6ff4915
commit 1934459b9b
+2 -1
View File
@@ -588,7 +588,8 @@ export class View extends Eventify(System) {
}
private _updateAdaptResult (width: number, height: number, windowId?: number) {
cclegacy.director.root.resize(width, height, windowId === undefined ? 1 : windowId);
// The default invalid windowId is 0
cclegacy.director.root.resize(width, height, (windowId === undefined || windowId === 0) ? 1 : windowId);
// Frame size changed, do resize works
const w = this._designResolutionSize.width;
const h = this._designResolutionSize.height;