1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 21:30:03 -04:00

Fix initial paint of web app (#5633)

* Broke in https://github.com/emilk/egui/pull/5631 (for _some_ apps)
This commit is contained in:
Emil Ernerfeldt
2025-01-23 13:47:52 +01:00
committed by GitHub
parent edbf4e8998
commit bc5f908b80
2 changed files with 13 additions and 8 deletions

View File

@@ -890,7 +890,7 @@ impl ResizeObserverContext {
let runner_ref = runner_ref.clone();
move |entries: js_sys::Array| {
if DEBUG_RESIZE {
// log::info!("ResizeObserverContext callback");
log::info!("ResizeObserverContext callback");
}
// Only call the wrapped closure if the egui code has not panicked
if let Some(mut runner_lock) = runner_ref.try_lock() {
@@ -919,6 +919,8 @@ impl ResizeObserverContext {
if let Err(err) = runner_ref.request_animation_frame() {
log::error!("{}", super::string_from_js_value(&err));
};
} else {
log::warn!("ResizeObserverContext callback: failed to lock runner");
}
}
}) as Box<dyn FnMut(js_sys::Array)>);