hajimehoshi / ebiten

Ebitengine - A dead simple 2D game engine for Go
https://ebitengine.org
Apache License 2.0
11.09k stars 665 forks source link

a resize event might not be fired on iOS Chrome #3067

Open eihigh opened 3 months ago

eihigh commented 3 months ago

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

eihigh commented 3 months ago

Wrong vs correct.

image image

hajimehoshi commented 3 months ago

We need a minimized test case.

eihigh commented 3 months ago

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.

hajimehoshi commented 2 months ago

I've succeded to reproduce the issue on Chrome on iPhone.

hajimehoshi commented 2 months ago

Is this possible to reproduce this on localhost?