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 b860990
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> {

Check failure on line 492 in crates/egui/src/memory.rs

View workflow job for this annotation

GitHub Actions / Check wasm32 + wasm-bindgen

attempt to use a non-constant value in a constant

Check failure on line 492 in crates/egui/src/memory.rs

View workflow job for this annotation

GitHub Actions / Format + check + test

attempt to use a non-constant value in a constant

Check failure on line 492 in crates/egui/src/memory.rs

View workflow job for this annotation

GitHub Actions / Check Windows

attempt to use a non-constant value in a constant
self.areas.get(id.into()).map(|state| state.rect())
}
}

/// ## Popups
Expand Down

0 comments on commit b860990

Please sign in to comment.