Make Canvas fill the parent container on Wasm
This commit is contained in:
parent
8a86ef14e3
commit
0c7f4eaab5
2 changed files with 6 additions and 2 deletions
|
|
@ -159,6 +159,10 @@ where
|
|||
use winit::platform::web::WindowExtWebSys;
|
||||
|
||||
let canvas = window.canvas().expect("Get window canvas");
|
||||
let _ = canvas.set_attribute(
|
||||
"style",
|
||||
"display: block; width: 100%; height: 100%",
|
||||
);
|
||||
|
||||
let window = web_sys::window().unwrap();
|
||||
let document = window.document().unwrap();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue