mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-04 10:14:07 +08:00
update resolution size after resize (#7860)
This commit is contained in:
@@ -41,6 +41,12 @@ jsb.onResume = function () {
|
||||
jsb.onResize = function (size) {
|
||||
if (size.width === 0 || size.height === 0) return;
|
||||
window.resize(size.width, size.height);
|
||||
|
||||
cc.sys.windowPixelResolution = {
|
||||
width: size.width,
|
||||
height: size.height,
|
||||
};
|
||||
|
||||
cc.view.setCanvasSize(window.innerWidth, window.innerHeight);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user