Description of the problem
I may have discovered a very strange bug:
If you adjust the three.js (full-screen) canvas size by calling renderer.setSize(window.innerWidth, window.innerHeight)
on resize, switching from landscape to portrait mode messes up window.innerWidth/Height.
Yup, it actually seems to change what window.innerWidth/Height returns.
I have set up a small test case inside this repository.
- Open test.html
- Fire up Devtools
- Toggle Device Toolbar
- Select a phone
- Switch from landscape to portrait mode and observe console output
This bug also occurs on my android phone with Chrome. It messes up a project real bad I am currently working on and I was able to get rid of the bug by excluding the line renderer.setSize(window.innerWidth, window.innerHeight)
.
I can add additional information and do further testing if this is not intended behaviour and I didn’t make a mistake.
Three.js version
- Dev
- r89
- …
Browser
- All of them
- Chrome [v. 63.0.3239.108 (Desktop), v. 63.0.3239.108 (Android)]
- Firefox
- Internet Explorer
OS
(As far as I was able to test it)
- All of them
- Windows
- macOS
- Linux
- Android
- iOS
I have the same issue also only on chrome.