Demo app: handle the case of wrong selected anchor
This commit is contained in:
parent
c3fc8997d6
commit
b360dffdbf
1 changed files with 7 additions and 0 deletions
|
@ -108,12 +108,19 @@ impl epi::App for WrapApp {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let mut found_anchor = false;
|
||||||
|
|
||||||
for (anchor, app) in self.apps.iter_mut() {
|
for (anchor, app) in self.apps.iter_mut() {
|
||||||
if anchor == self.selected_anchor || ctx.memory().everything_is_visible() {
|
if anchor == self.selected_anchor || ctx.memory().everything_is_visible() {
|
||||||
app.update(ctx, frame);
|
app.update(ctx, frame);
|
||||||
|
found_anchor = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !found_anchor {
|
||||||
|
self.selected_anchor = "demo".into();
|
||||||
|
}
|
||||||
|
|
||||||
self.backend_panel.end_of_frame(ctx);
|
self.backend_panel.end_of_frame(ctx);
|
||||||
|
|
||||||
self.ui_file_drag_and_drop(ctx);
|
self.ui_file_drag_and_drop(ctx);
|
||||||
|
|
Loading…
Reference in a new issue