mirror of
https://github.com/storytold/egui.git
synced 2026-11-30 18:27:20 +01:00
Demo app: handle the case of wrong selected anchor
This commit is contained in:
1 parent
c3fc8997d6
commit
b360dffdbf
1 file changed
+7
@@ -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