Skip to content

Commit

Permalink
Fix wasm part
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenhuyn committed Sep 18, 2024
1 parent 4fec53c commit f465124
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cubeway/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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(())
})
Expand Down

0 comments on commit f465124

Please sign in to comment.