Open eihigh opened 3 months ago
Wrong vs correct.
We need a minimized test case.
I reproduced in https://issue-3067-resize.pages.dev/ . The code is here https://github.com/eihigh/issue-3067-resize/tree/main
It just opens a wasm player in a new tab. If you open the player (https://issue-3067-resize.pages.dev/play/) directly, it seems to work fine.
I've succeded to reproduce the issue on Chrome on iPhone.
Is this possible to reproduce this on localhost?
Ebitengine Version
latest
Operating System
Go Version (
go version
)go1.22.6
What steps will reproduce the problem?
Open a wasm binary in this page https://a28924d7.go-wasm-player.pages.dev/
I reproduced only on iOS Chrome.
What is the expected result?
Rendered in the correct aspect ratio
What happens instead?
Shrink a little vertically from the correct aspect ratio.
Anything else you feel useful to add?
There seems to be some cases where the screen resizes without the resize event being fired in mobile browsers.
I fixed this issue with
ResizeObserver
that captures all resizings. See https://github.com/eihigh/go-wasm-player/commit/320e6e4b68c162a58ab2e6c25fc62bdd303d31d2