1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05:40:03 -04:00

Clarify logic around how viewports are retained, and add ViewportIdSet

This commit is contained in:
Emil Ernerfeldt
2023-11-07 11:14:04 +01:00
parent 54c6d51b66
commit 645521bcee
5 changed files with 32 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
use std::{num::NonZeroU32, sync::Arc};
use egui::{ViewportId, ViewportIdMap};
use egui::{ViewportId, ViewportIdMap, ViewportIdSet};
use crate::{renderer, RenderState, SurfaceErrorAction, WgpuConfiguration};
@@ -625,7 +625,7 @@ impl Painter {
screenshot
}
pub fn clean_surfaces(&mut self, available_viewports: &[ViewportId]) {
pub fn clean_surfaces(&mut self, available_viewports: &ViewportIdSet) {
self.surfaces
.retain(|id, _| available_viewports.contains(id));
self.depth_texture_view