Skip to content
This repository has been archived by the owner on Feb 17, 2022. It is now read-only.

Window/canvas dimensions set to 0,0 due to floating point precision issue. #155

Open
kindjie opened this issue Nov 11, 2021 · 0 comments
Open

Comments

@kindjie
Copy link

kindjie commented Nov 11, 2021

In some instances, it seems the check for whether there's CSS sizing the canvas can fail in Emscripten_CreateWindow(). This makes it seem like the canvas disappears when a window is created.

The cause is that the retrieved values for css_w and css_h can be just under 1.0. The following floor() then returns 0.0 instead of 1.0, which sets external_size to true. The 0,0 dimensions is then carried through the creation of the window.

A work around is to set the canvas size in CSS, but to fix it a more robust check should be made in Emscripten_CreateWindow().

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant