diff --git a/examples/with_winit/src/lib.rs b/examples/with_winit/src/lib.rs index dc46b54..e08add2 100644 --- a/examples/with_winit/src/lib.rs +++ b/examples/with_winit/src/lib.rs @@ -483,8 +483,9 @@ pub fn main() -> Result<()> { let window = create_window(&event_loop); // On wasm, append the canvas to the document body let canvas = window.canvas(); - canvas.set_width(1044); - canvas.set_height(800); + let size = window.inner_size(); + canvas.set_width(size.width); + canvas.set_height(size.height); web_sys::window() .and_then(|win| win.document()) .and_then(|doc| doc.body())