Skip to content
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

Incorrect canvas size in browser #184

Open
alexforencich opened this issue Jan 23, 2025 · 5 comments
Open

Incorrect canvas size in browser #184

alexforencich opened this issue Jan 23, 2025 · 5 comments

Comments

@alexforencich
Copy link

I am seeing this issue when running the code in this repo verbatim with "trunk serve". Effectively, the UI does not appear to be rendering correctly in the browser, and I tested in both Firefox and Chromium. It looks like the UI "zooms in" immediately on load; it renders much too large for a fraction of a second and then disappears. Opening the developer console in Chrome doesn't show any useful log entries, but mousing over the canvas reports the canvas size as 22369600 x 22369600. Similarly, opening the developer console in Firefox reveals log entries about very large requested sizes. I also rolled the repo back to 0.29 and 0.28 and got the same result.

Firefox:

Image

Chromium:

Image

@alexforencich
Copy link
Author

Some more results:

This page renders correctly: https://elliottslaughter.github.io/legion-prof-viewer/

However, building and running https://github.com/elliottslaughter/legion-prof-viewer locally results in a very strange result: it renders with the correct width, but much too short, and then the canvas grows vertically on every redraw, quickly extending off the bottom of the window. Seems like there is probably a change in some dependency that isn't totally locked down.

@c-git
Copy link
Contributor

c-git commented Jan 23, 2025

Does this https://emilk.github.io/eframe_template/ page render correctly for you?

For me it looks like

Page Screen Shot

The logs are also fairly benign

Logs screenshot

@alexforencich
Copy link
Author

Yes, it does render correctly on my end.

@alexforencich
Copy link
Author

alexforencich commented Jan 23, 2025

Here is the cargo.lock file for when I build eframe_template on my end:

Cargo.lock.zip

And the build log:

$ trunk serve
2025-01-23T07:25:10.203785Z  INFO 🚀 Starting trunk 0.21.6
2025-01-23T07:25:10.207362Z  INFO 📦 starting build
   Compiling proc-macro2 v1.0.92
   Compiling unicode-ident v1.0.12
   Compiling cfg-if v1.0.0
   Compiling wasm-bindgen-shared v0.2.99
   Compiling serde v1.0.216
   Compiling version_check v0.9.4
   Compiling bumpalo v3.14.0
   Compiling log v0.4.22
   Compiling autocfg v1.1.0
   Compiling once_cell v1.20.2
   Compiling wasm-bindgen v0.2.99
   Compiling parking_lot_core v0.9.9
   Compiling scopeguard v1.2.0
   Compiling ttf-parser v0.20.0
   Compiling smallvec v1.11.2
   Compiling ab_glyph_rasterizer v0.1.8
   Compiling zerocopy v0.7.32
   Compiling base64 v0.21.5
   Compiling profiling v1.0.16
   Compiling epaint_default_fonts v0.30.0
   Compiling nohash-hasher v0.2.0
   Compiling litrs v0.4.1
   Compiling percent-encoding v2.3.1
   Compiling raw-window-handle v0.6.2
   Compiling static_assertions v1.1.0
   Compiling ahash v0.8.11
   Compiling slotmap v1.0.7
   Compiling document-features v0.2.10
   Compiling lock_api v0.4.11
   Compiling memoffset v0.9.0
   Compiling quote v1.0.37
   Compiling syn v2.0.90
   Compiling parking_lot v0.12.1
   Compiling owned_ttf_parser v0.20.0
   Compiling ab_glyph v0.2.23
   Compiling wasm-bindgen-backend v0.2.99
   Compiling wasm-bindgen-macro-support v0.2.99
   Compiling serde_derive v1.0.216
   Compiling bytemuck_derive v1.5.0
   Compiling enumn v0.1.13
   Compiling wasm-bindgen-macro v0.2.99
   Compiling js-sys v0.3.76
   Compiling bytemuck v1.20.0
   Compiling web-sys v0.3.76
   Compiling wasm-bindgen-futures v0.4.49
   Compiling web-time v1.1.0
   Compiling emath v0.30.0
   Compiling bitflags v2.6.0
   Compiling accesskit v0.17.1
   Compiling ron v0.8.1
   Compiling ecolor v0.30.0
   Compiling epaint v0.30.0
   Compiling egui v0.30.0
   Compiling glow v0.16.0
   Compiling egui_glow v0.30.0
   Compiling eframe v0.30.0
   Compiling eframe_template v0.1.0 (/home/alex/Projects/eframe_template)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 32.93s
2025-01-23T07:25:44.844192Z  INFO applying new distribution
2025-01-23T07:25:44.847515Z  INFO ✅ success
2025-01-23T07:25:44.847656Z  INFO 📡 serving static assets at -> /
2025-01-23T07:25:44.848493Z  INFO 📡 server listening at:
2025-01-23T07:25:44.848521Z  INFO     🏠 http://127.0.0.1:8080/
2025-01-23T07:25:44.848537Z  INFO     🏠 http://[::1]:8080/
2025-01-23T07:25:44.848754Z  INFO     🏠 http://localhost.:8080/

@c-git
Copy link
Contributor

c-git commented Jan 23, 2025

Humm I opened the template repo in a github workspace and tried it in Brave and wasn't able to reproduce the problem. Are you able to reproduce it in a github codespace?

I only get somewhat expected errors in the console and it looks fine.

Image

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

No branches or pull requests

2 participants