Change mouse_event_handler to use HandlerSet

This commit is contained in:
K Simmons
2022-07-18 10:08:14 -07:00
parent ec25fa9260
commit deeefed7eb
2 changed files with 26 additions and 12 deletions
+10 -1
View File
@@ -15,11 +15,20 @@ pub struct MouseRegion {
impl MouseRegion {
pub fn new(view_id: usize, discriminant: Option<(TypeId, usize)>, bounds: RectF) -> Self {
Self::from_handlers(view_id, discriminant, bounds, Default::default())
}
pub fn from_handlers(
view_id: usize,
discriminant: Option<(TypeId, usize)>,
bounds: RectF,
handlers: HandlerSet,
) -> Self {
Self {
view_id,
discriminant,
bounds,
handlers: Default::default(),
handlers,
}
}