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

Window: store inner size + misc improvements

This commit is contained in:
Emil Ernerfeldt
2020-04-21 20:46:30 +02:00
parent 8b4e506493
commit a56a869f48
2 changed files with 128 additions and 58 deletions

View File

@@ -44,10 +44,11 @@ impl Memory {
}
}
/// TODO: call once at the start of the frame for the current mouse pos
pub fn layer_at(&self, pos: Pos2) -> Layer {
for window_id in self.window_order.iter().rev() {
if let Some(state) = self.windows.get(window_id) {
if state.rect.contains(pos) {
if state.outer_rect.contains(pos) {
return Layer::Window(*window_id);
}
}