Skip to content

Commit

Permalink
Use a ViewportIdSet
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Nov 7, 2023
1 parent a3b0200 commit 701301e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crates/egui/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1459,7 +1459,7 @@ impl Context {
pub fn end_frame(&self) -> FullOutput {
crate::profile_function!();

let mut viewports: Vec<ViewportId> = self.write(|ctx| {
let mut viewports: ViewportIdSet = self.write(|ctx| {
ctx.layer_rects_prev_frame.insert(
ctx.viewport_id(),
ctx.layer_rects_this_frame
Expand All @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion crates/egui/src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::{
area,
window::{self, WindowInteraction},
EventFilter, Id, IdMap, InputState, LayerId, Pos2, Rect, Style, ViewportId, ViewportIdMap,
ViewportIdSet,
};

// ----------------------------------------------------------------------------
Expand Down Expand Up @@ -561,7 +562,7 @@ impl Memory {
pub(crate) fn end_frame(
&mut self,
input: &InputState,
viewports: &[ViewportId],
viewports: &ViewportIdSet,
used_ids: &IdMap<Rect>,
) {
self.caches.update();
Expand Down

0 comments on commit 701301e

Please sign in to comment.