Skip to content

Commit

Permalink
Expose area::State's Rect in Memory
Browse files Browse the repository at this point in the history
  • Loading branch information
tosti007 committed Jul 18, 2023
1 parent 083d61f commit 6c693a6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/egui/src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Id>) -> Option<Rect> {
self.areas.get(id.into()).map(|state| state.rect())
}
}

/// ## Popups
Expand Down

0 comments on commit 6c693a6

Please sign in to comment.