From f4651241568b0caa07d0f1bbe28688506ae79291 Mon Sep 17 00:00:00 2001 From: stevenhuyn <18359644+stevenhuyn@users.noreply.github.com> Date: Wed, 18 Sep 2024 16:05:43 -0700 Subject: [PATCH] Fix wasm part --- cubeway/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cubeway/src/lib.rs b/cubeway/src/lib.rs index 8a5fa8d..44ee9a0 100644 --- a/cubeway/src/lib.rs +++ b/cubeway/src/lib.rs @@ -545,7 +545,7 @@ pub async fn run(particle_count: usize) { // Winit prevents sizing with CSS, so we have to set // the size manually when on web. use winit::dpi::PhysicalSize; - window.set_inner_size(PhysicalSize::new(1280, 720)); + let _ = window.request_inner_size(PhysicalSize::new(1280, 720)); use winit::platform::web::WindowExtWebSys; web_sys::window() @@ -555,7 +555,7 @@ pub async fn run(particle_count: usize) { .query_selector("cubeway-simulation") .expect("Couldn't find cubeway-simluation web component in document") .expect("Couldn't unwrap query selector result"); - let canvas = web_sys::Element::from(window.canvas()); + let canvas = web_sys::Element::from(window.canvas()?); dst.append_child(&canvas).ok()?; Some(()) })