Demo app: handle the case of wrong selected anchor

This commit is contained in:
Emil Ernerfeldt 2022-02-21 15:29:18 +01:00
parent c3fc8997d6
commit b360dffdbf

View file

@ -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);