fix: panic when overlay event processing removes overlay

This commit is contained in:
Nick Senger 2023-02-11 09:11:00 -08:00
parent 92ba26b8a1
commit 41822d0dc5

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)
{ })
.map(|_| {
// TODO: Type-safe cursor availability // TODO: Type-safe cursor availability
Point::new(-1.0, -1.0) Point::new(-1.0, -1.0)
} else { })
cursor_position .unwrap_or(cursor_position);
};
self.overlay = Some(layout); self.overlay = Some(layout);