mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 14:49:06 -04:00
Demo app: handle the case of wrong selected anchor
This commit is contained in:
@@ -108,12 +108,19 @@ impl epi::App for WrapApp {
|
||||
});
|
||||
}
|
||||
|
||||
let mut found_anchor = false;
|
||||
|
||||
for (anchor, app) in self.apps.iter_mut() {
|
||||
if anchor == self.selected_anchor || ctx.memory().everything_is_visible() {
|
||||
app.update(ctx, frame);
|
||||
found_anchor = true;
|
||||
}
|
||||
}
|
||||
|
||||
if !found_anchor {
|
||||
self.selected_anchor = "demo".into();
|
||||
}
|
||||
|
||||
self.backend_panel.end_of_frame(ctx);
|
||||
|
||||
self.ui_file_drag_and_drop(ctx);
|
||||
|
||||
Reference in New Issue
Block a user