Tweak canvas aspect ratio

This commit is contained in:
Raph Levien 2022-11-29 19:42:52 -08:00
parent 340ac1d69c
commit c4274c7153

View file

@ -112,7 +112,7 @@ async fn run_wasm(event_loop: EventLoop<()>, window: Window) {
fn main() { fn main() {
#[cfg(not(target_arch = "wasm32"))] #[cfg(not(target_arch = "wasm32"))]
{ {
pollster::block_on(run()).unwrap(); pollster::block_on(run());
} }
#[cfg(target_arch = "wasm32")] #[cfg(target_arch = "wasm32")]
{ {
@ -125,8 +125,8 @@ fn main() {
// On wasm, append the canvas to the document body // On wasm, append the canvas to the document body
let canvas = window.canvas(); let canvas = window.canvas();
canvas.set_width(1024); canvas.set_width(1044);
canvas.set_height(1024); canvas.set_height(800);
web_sys::window() web_sys::window()
.and_then(|win| win.document()) .and_then(|win| win.document())
.and_then(|doc| doc.body()) .and_then(|doc| doc.body())