Merge pull request #1700 from nicksenger/overlay/fix-panic

Fix panic when overlay event processing removes overlay
This commit is contained in:
Héctor Ramón 2023-02-14 06:40:21 +01:00 committed by GitHub
commit efbf66b0a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -263,16 +263,16 @@ where
} }
} }
let base_cursor = if manual_overlay let base_cursor = manual_overlay
.as_ref() .as_ref()
.unwrap() .filter(|overlay| {
.is_over(Layout::new(&layout), cursor_position) overlay.is_over(Layout::new(&layout), cursor_position)
{ })
// TODO: Type-safe cursor availability .map(|_| {
Point::new(-1.0, -1.0) // TODO: Type-safe cursor availability
} else { Point::new(-1.0, -1.0)
cursor_position })
}; .unwrap_or(cursor_position);
self.overlay = Some(layout); self.overlay = Some(layout);