Cocos Creator 3D V1.1.2 动态设置 FIXED_WIDTH和FIXED_HIGHT

要怎么动态设置
FIXED_WIDTH和FIXED_HIGHT
这样写不行

cc.view.setResizeCallback(function () {
    var rect = cc.game.canvas.getBoundingClientRect();
    if (rect.width > rect.height) {
        cc.view.setDesignResolutionSize(rect.width, rect.height, cc.ResolutionPolicy.SHOW_ALL);
    }
    else {
        cc.view.setDesignResolutionSize(rect.width, rect.height,  cc.ResolutionPolicy.FIXED_WIDTH);
    }
    console.log(rect.width, rect.height);
});

这个设置看起来没问题,不行的依据是?