-
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
Web canvas size is tiny for the first frame #4622
Comments
This is caused by the first Because the resize observer is called not just on every resize but also on the call to |
This PR ensures the first animation frame happens _after_ the resize observer has had a chance to do its job. * Closes #4622 The first commit contains some `log` calls to observe the changed behavior: Before: ``` [eframe::web::app_runner] eframe/src/web/app_runner.rs:191: LOGIC [300.0 150.0] [eframe::web::events] eframe/src/web/events.rs:633: ResizeObserver canvas=[300.0 150.0] to=(1920, 993) [eframe::web::app_runner] eframe/src/web/app_runner.rs:191: LOGIC [1920.0 993.0] [eframe::web::app_runner] eframe/src/web/app_runner.rs:191: LOGIC [1920.0 993.0] ``` After: ``` [eframe::web::events] eframe/src/web/events.rs:633: ResizeObserver canvas=[300.0 150.0] to=(1920, 993) [eframe::web::app_runner] eframe/src/web/app_runner.rs:191: LOGIC [1920.0 993.0] [eframe::web::app_runner] eframe/src/web/app_runner.rs:191: LOGIC [1920.0 993.0] ```
This PR ensures the first animation frame happens _after_ the resize observer has had a chance to do its job. * Closes emilk#4622 The first commit contains some `log` calls to observe the changed behavior: Before: ``` [eframe::web::app_runner] eframe/src/web/app_runner.rs:191: LOGIC [300.0 150.0] [eframe::web::events] eframe/src/web/events.rs:633: ResizeObserver canvas=[300.0 150.0] to=(1920, 993) [eframe::web::app_runner] eframe/src/web/app_runner.rs:191: LOGIC [1920.0 993.0] [eframe::web::app_runner] eframe/src/web/app_runner.rs:191: LOGIC [1920.0 993.0] ``` After: ``` [eframe::web::events] eframe/src/web/events.rs:633: ResizeObserver canvas=[300.0 150.0] to=(1920, 993) [eframe::web::app_runner] eframe/src/web/app_runner.rs:191: LOGIC [1920.0 993.0] [eframe::web::app_runner] eframe/src/web/app_runner.rs:191: LOGIC [1920.0 993.0] ```
Repro
Result
The symptom is that all windows gets squashed to a very small size, and pushed to the top left corner:
The text was updated successfully, but these errors were encountered: