1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-03 15:20:05 -04:00

Always use the latest async callback when rendering a viewport

This commit is contained in:
Emil Ernerfeldt
2023-11-07 09:48:07 +01:00
parent 6643713cc0
commit 7bc5698079
3 changed files with 30 additions and 46 deletions

View File

@@ -1548,7 +1548,7 @@ impl Context {
let mut viewports = Vec::new();
self.write(|ctx| {
ctx.viewports.retain(|_, viewport| {
let retain = viewport.used;
let was_used = viewport.used;
if viewport_id == viewport.id_pair.parent {
viewport.used = false;
@@ -1559,7 +1559,7 @@ impl Context {
id_pair: viewport.id_pair,
viewport_ui_cb: viewport.viewport_ui_cb.clone(),
});
(retain || viewport_id != viewport.id_pair.parent)
(was_used || viewport_id != viewport.id_pair.parent)
&& available_viewports.contains(&viewport.id_pair.parent)
});
});