1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 14:49:06 -04:00

Use canvas directly (#4780)

This commit is contained in:
Jan Procházka
2024-07-15 18:59:15 +02:00
committed by GitHub
parent cb9f30482f
commit 0d89e31e3e
10 changed files with 22 additions and 27 deletions

View File

@@ -166,7 +166,7 @@
check_for_panic();
handle.start("the_canvas_id").then(on_app_started).catch(on_error);
handle.start(document.getElementById("the_canvas_id")).then(on_app_started).catch(on_error);
}
function on_app_started(handle) {

View File

@@ -138,7 +138,10 @@
const handle_one = new wasm_bindgen.WebHandle();
const handle_two = new wasm_bindgen.WebHandle();
Promise.all([handle_one.start("canvas_id_one"), handle_two.start("canvas_id_two")]).then((handles) => {
Promise.all([
handle_one.start(document.getElementById("canvas_id_one")),
handle_two.start(document.getElementById("canvas_id_two")),
]).then((handles) => {
on_apps_started(handle_one, handle_two)
}).catch(on_error);
}