-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
canvas dimensions are broken in 0.19 #1947
Comments
eframe scales the canvas to the size of the scroll width/height of its parent (changed in #1650). I don't know what that means for your HTML/CSS (my web skills are severely lacking), but for the official demo the only change needed was adding The automatic resizing of the canvas should perhaps be opt-in, and should definitely be better documented. If you have any suggestions here, I'm all ears. |
Adding Looking at the browser logs I can actually see that there was a log warning me about this! If more people end up hitting this it might be worth replacing that log with some logic to directly set the But tbh, I would rather see egui get some kind of robust web implementation where an app can dynamically fit within a larger page, like what is provided by rust-windowing/winit#2074 So I dont think there is much value in improving the developer UX of the current solution. So I'll go ahead and close this issue, feel free to re-open if you do want to track improvements to the current width/height handling. |
It was done exactly to NOT doing this, to leave control what size of canvas and layout you want - on the html-side.
Problem with that "continiously incrementing height" is because your parent container resizes to fit child content, and our child resizes to fit parent. so you have loop somewhere perhaps caused by a rounding. Perhaps resizing to parent.height-1 could work. but actually this have no sence because you always want child to fit parent, not the opposite. BTW I have same behavior on egui layout itself. PS: didn't see this issue to react earlier |
Describe the bug
My app is setup to create a minimal webpage to run the wasm app without using https://github.com/emilk/eframe_template/
In 0.18 this worked pretty well. I had to click on the app once for it to take up the entire page but I didnt bother investigating that because it wasnt high priority.
However with 0.19 the app is now suddenly unusable.
Without clicking, moving the mouse will cause the canvas height to grow until the app eventually crashes from the absurd height.
2022-08-21_12-34-37.mp4
And clicking will cause the canvas height to be set way too small.
To Reproduce
I published my little app here so you can easily reproduce the issue:
git clone https://github.com/rukai/bench_viewer cd bench_viewer cargo run-wasm bench_viewer --release
If you want to see the html spit out by the build process:
output:
Expected behavior
I expect egui to function without the full template.
Or at least document which parts of the template are a hard requirement and issue warnings in debug builds when the required parts of the template are missing.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: