-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Memory::area_rect
#3161
Add Memory::area_rect
#3161
Conversation
abf5f68
to
8e812a6
Compare
area::State
in Memoryarea::State
's Rect
in Memory
b860990
to
6c693a6
Compare
crates/egui/src/memory.rs
Outdated
@@ -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> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to link to this function from the docs of Window
and Area
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
9145473
to
eca56ee
Compare
I added the doc-links on |
@@ -21,6 +21,9 @@ use super::*; | |||
/// ui.label("Hello World!"); | |||
/// }); | |||
/// # }); | |||
/// ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also did a drive-by fix here.
eca56ee
to
c5f0cdb
Compare
area::State
's Rect
in Memoryarea::State
's Rect
in Memory
area::State
's Rect
in Memoryarea::State
's Rect
in Memory
Currently, there is no way of obtaining any information on windows from
Memory
, even though this is in fact stored in there. This PR exposes thearea::State
struct as public and adds a function to obtain saidState
for a window.