Skip to content

Web canvas size is tiny for the first frame #4622

@emilk

Description

@emilk

Repro

--- a/crates/eframe/src/web/app_runner.rs
+++ b/crates/eframe/src/web/app_runner.rs
@@ -188,6 +188,7 @@ impl AppRunner {
     /// The result can be painted later with a call to [`Self::run_and_paint`] or [`Self::paint`].
     pub fn logic(&mut self) {
         let canvas_size = super::canvas_size_in_points(self.canvas(), self.egui_ctx());
+        log::info!("canvas_size: {canvas_size:?}");
         let raw_input = self.input.new_frame(canvas_size);
 
         let full_output = self.egui_ctx.run(raw_input, |egui_ctx| {
./scripts/build_demo_web.sh && ./scripts/start_server.sh

Result

image

The symptom is that all windows gets squashed to a very small size, and pushed to the top left corner:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is brokeneframeRelates to epi and eframewebRelated to running Egui on the web

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions