diff --git a/crates/egui/src/context.rs b/crates/egui/src/context.rs index 4e0c427bbf3..860413c35e8 100644 --- a/crates/egui/src/context.rs +++ b/crates/egui/src/context.rs @@ -1459,7 +1459,7 @@ impl Context { pub fn end_frame(&self) -> FullOutput { crate::profile_function!(); - let mut viewports: Vec = self.write(|ctx| { + let mut viewports: ViewportIdSet = self.write(|ctx| { ctx.layer_rects_prev_frame.insert( ctx.viewport_id(), ctx.layer_rects_this_frame @@ -1468,7 +1468,7 @@ impl Context { ); ctx.viewports.values().map(|vp| vp.id_pair.this).collect() }); - viewports.push(ViewportId::ROOT); + viewports.insert(ViewportId::ROOT); if self.input(|i| i.wants_repaint()) { self.request_repaint(); diff --git a/crates/egui/src/memory.rs b/crates/egui/src/memory.rs index 343e0598d37..89b4a745109 100644 --- a/crates/egui/src/memory.rs +++ b/crates/egui/src/memory.rs @@ -6,6 +6,7 @@ use crate::{ area, window::{self, WindowInteraction}, EventFilter, Id, IdMap, InputState, LayerId, Pos2, Rect, Style, ViewportId, ViewportIdMap, + ViewportIdSet, }; // ---------------------------------------------------------------------------- @@ -561,7 +562,7 @@ impl Memory { pub(crate) fn end_frame( &mut self, input: &InputState, - viewports: &[ViewportId], + viewports: &ViewportIdSet, used_ids: &IdMap, ) { self.caches.update();