Dynamic screen size change - issue

Hi guys! I am experimenting some issues when changing the size of my frame on resize callback.

I have:

function setScreen() {
 const actual_size = cc.view.getFrameSize();
 isMobile = (actual_size.width < 768);
 const width = isMobile ? 640 : 960;
 const height = isMobile ? 960 : 640;
 cc.view.setDesignResolutionSize(width, height, cc.ResolutionPolicy.SHOW_ALL);
}

cc.view.resizeWithBrowserSize(true);
cc.view.setResizeCallback(setScreen);

This works fine the first time, but when I resize the screen:


But when I do the resize the things left like this:


Is there any other method than I can exec to re locate objects correctly?

Edit
If I call runScene after resize its works good, but I dont want to rebuild scene!

Edit 2
Can’t do dinamic change, but I build something good:

At the beginning I detect if is mobile or desktop and if is portrait or landscape
Then do the screenView:

If is mobile, do view PORTRAIT,
If is mobile and lanscapte, do view PORTRAIT and show a popup to please rotate your phone
If is desktop, do view LANDSCAPTE.

But i Cant change the LANDSCAPTE or PORTRAIT only with resize :frowning: