-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JS] Window.js.hx width and height stay the same on window resize #668
Comments
So I've tried something, I was using the index.html from https://heaps.io/documentation/hello-world.html I've also tried the one from the samples (base2d) and this behavior is the normal expected one. |
onResize and windows size represents your canvas size, so it needs to be set to 100% to adjust to the browser window. |
[Edit] Just going to open a new issue since these are not the exact same. I'd like to reopen this; setting the canvas width to 100% in the index.html page appears to no longer work on Chrome v118.0.5993.70.
Using the web inspector I saw my canvas was being automatically assigned a style on the element level, So I dug into the code and found this code in
I can confirm this gets hit and canvas.style.width is an empty string, so my css is now ignored. If I comment out this style change, the canvas is correctly assigned the 100% width from my css. This code is almost a decade old, though; did some other change make it so this canvas.style.width value is now an empty string when it wasn't previously? |
The width and height stay at the same value as as when first opened int the browser and in turn resize events aren't triggered.
The text was updated successfully, but these errors were encountered: