mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 05:40:03 -04:00
Use canvas directly (#4780)
This commit is contained in:
@@ -32,10 +32,13 @@ impl WebHandle {
|
||||
|
||||
/// Call this once from JavaScript to start your app.
|
||||
#[wasm_bindgen]
|
||||
pub async fn start(&self, canvas_id: &str) -> Result<(), wasm_bindgen::JsValue> {
|
||||
pub async fn start(
|
||||
&self,
|
||||
canvas: web_sys::HtmlCanvasElement,
|
||||
) -> Result<(), wasm_bindgen::JsValue> {
|
||||
self.runner
|
||||
.start(
|
||||
canvas_id,
|
||||
canvas,
|
||||
eframe::WebOptions::default(),
|
||||
Box::new(|cc| Ok(Box::new(WrapApp::new(cc)))),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user