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

egui-wgpu: Fix crash on zero-sized scissor rects (#2039)

This commit is contained in:
Emil Ernerfeldt
2022-09-13 09:32:05 +02:00
committed by GitHub
parent 2842d390c9
commit c5495d69fb
2 changed files with 13 additions and 10 deletions

View File

@@ -74,7 +74,13 @@ pub trait App {
/// Can be used from web to interact or other external context
/// Implementation is needed, because downcasting Box<dyn App> -> Box<dyn Any> to get &ConcreteApp is not simple in current rust.
///
/// Just return &mut *self
/// Just copy-paste this as your implementation:
/// ```ignore
/// #[cfg(target_arch = "wasm32")]
/// fn as_any_mut(&mut self) -> &mut dyn std::any::Any {
/// &mut *self
/// }
/// ```
#[cfg(target_arch = "wasm32")]
fn as_any_mut(&mut self) -> &mut dyn Any;