Use correct canvas size for scale factor change

This commit is contained in:
dAxpeDDa 2023-06-04 14:29:59 +02:00 committed by daxpedda
parent 8f7f3efc0d
commit c88a4ab221
7 changed files with 69 additions and 52 deletions

View file

@ -59,7 +59,10 @@ mod wasm {
let body = document.body().unwrap();
// Set a background color for the canvas to make it easier to tell where the canvas is for debugging purposes.
canvas.style().set_css_text("background-color: crimson;");
canvas
.style()
.set_property("background-color", "crimson")
.unwrap();
body.append_child(&canvas).unwrap();
let log_header = document.create_element("h2").unwrap();