Enable event propagation (#3062)
This commit is contained in:
parent
7541220a41
commit
1dfca5a395
7 changed files with 75 additions and 176 deletions
|
|
@ -168,12 +168,7 @@ impl PointerHandler {
|
|||
prevent_default: bool,
|
||||
) where
|
||||
MOD: 'static + FnMut(ModifiersState),
|
||||
M: 'static
|
||||
+ FnMut(
|
||||
ModifiersState,
|
||||
i32,
|
||||
&mut dyn Iterator<Item = (PhysicalPosition<f64>, PhysicalPosition<f64>)>,
|
||||
),
|
||||
M: 'static + FnMut(ModifiersState, i32, &mut dyn Iterator<Item = PhysicalPosition<f64>>),
|
||||
T: 'static
|
||||
+ FnMut(ModifiersState, i32, &mut dyn Iterator<Item = (PhysicalPosition<f64>, Force)>),
|
||||
B: 'static + FnMut(ModifiersState, i32, PhysicalPosition<f64>, ButtonsState, MouseButton),
|
||||
|
|
@ -223,22 +218,12 @@ impl PointerHandler {
|
|||
// pointer move event
|
||||
let scale = super::scale_factor(&window);
|
||||
match pointer_type.as_str() {
|
||||
"mouse" => {
|
||||
let mut delta = event::MouseDelta::init(&window, &event);
|
||||
|
||||
mouse_handler(
|
||||
modifiers,
|
||||
id,
|
||||
&mut event::pointer_move_event(event).map(|event| {
|
||||
let position = event::mouse_position(&event).to_physical(scale);
|
||||
let delta = delta
|
||||
.delta(&event)
|
||||
.to_physical(super::scale_factor(&window));
|
||||
|
||||
(position, delta)
|
||||
}),
|
||||
)
|
||||
}
|
||||
"mouse" => mouse_handler(
|
||||
modifiers,
|
||||
id,
|
||||
&mut event::pointer_move_event(event)
|
||||
.map(|event| event::mouse_position(&event).to_physical(scale)),
|
||||
),
|
||||
"touch" => touch_handler(
|
||||
modifiers,
|
||||
id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue