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:
@@ -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)>);
|
||||
|
||||
Reference in New Issue
Block a user