-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
windowWidth and windowHeight not being mapped correctly to counterparts #6396
Comments
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you! |
This isn't a bug afaik, because if you reload the page it works, |
@Evorage0 This happens because Chromium incorrectly included the bookmarks bar in the height calculation on page load when the user hides the bookmark bar when not on empty page. Firefox does not include the bar at all when it is set to be hidden except for on empty page so it gets consistent value, while Chromium likely calculate it on the fly, making the two values different between line execution (that's my guess at least). As noted this is not an issue with p5.js and we can't really resolve this on our side since it is a problem with incorrect value provided by Chromium. I'll close this for now and this problem should be reported to Chromium instead. Thanks! |
Just want to point out that we might be able to work around this: in the example code, |
The value of Firefox doesn't fire a resize event under these circumstances while Chrome does, another side effect is this is not consistent. I was able to replicate the issue yesterday but not anymore, which sounds like a race condition to me. We can change when the initial value is set (currently set during initialization) but I'm not entirely sure how well it will work considering the value is updated by the window resize event so we may not be getting the initial value anyway. |
I believe this has now been solved by #7134 which implements the solution dave mentioned above |
Most appropriate sub-area of p5.js?
p5.js version
1.7.0
Web browser and version
Microsoft Edge 116.0.1938.69; Chromium version 116.0.5845.141
Operating System
Windows 11 Version 22H2 (Build 22621.2134)
Steps to reproduce this
Steps:
Snippet:
This behaviour occurs on MS edge (running chromium). Discord user: davepagurek (138146691151822848) tested this issue in a chrome browser which resulted in the same bug, they also tested this in a firefox browser which did not result in this oddity happening which suggests that it is an issue with chromium.
I found that after refreshing the tab, the values are the same so this bug occurs only in new tabs.
2023-09-05.23-12-36.mp4
Possible Fix:
Set the values of windowWidth and windowHeight manually before calling the setup() function.
The text was updated successfully, but these errors were encountered: