diff --git a/crates/egui/src/memory.rs b/crates/egui/src/memory.rs index db76f7e7c6a0..c18188679d05 100644 --- a/crates/egui/src/memory.rs +++ b/crates/egui/src/memory.rs @@ -487,6 +487,11 @@ impl Memory { pub fn reset_areas(&mut self) { self.areas = Default::default(); } + + /// Obtain the previous area rect of a window. + pub fn window_rect(&self, id: impl Into) -> Option { + self.areas.get(id).map(|state| state.rect()) + } } /// ## Popups