Fix iOS gesture deltas (#3426)
This commit is contained in:
parent
98d3391f2d
commit
ef2ec904ce
1 changed files with 4 additions and 4 deletions
|
|
@ -182,13 +182,11 @@ declare_class!(
|
||||||
state => panic!("unexpected recognizer state: {:?}", state),
|
state => panic!("unexpected recognizer state: {:?}", state),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Flip the velocity to match macOS.
|
|
||||||
let delta = -recognizer.velocity() as _;
|
|
||||||
let gesture_event = EventWrapper::StaticEvent(Event::WindowEvent {
|
let gesture_event = EventWrapper::StaticEvent(Event::WindowEvent {
|
||||||
window_id: RootWindowId(window.id()),
|
window_id: RootWindowId(window.id()),
|
||||||
event: WindowEvent::PinchGesture {
|
event: WindowEvent::PinchGesture {
|
||||||
device_id: DEVICE_ID,
|
device_id: DEVICE_ID,
|
||||||
delta,
|
delta: recognizer.velocity() as _,
|
||||||
phase,
|
phase,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
@ -228,11 +226,13 @@ declare_class!(
|
||||||
state => panic!("unexpected recognizer state: {:?}", state),
|
state => panic!("unexpected recognizer state: {:?}", state),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Flip the velocity to match macOS.
|
||||||
|
let delta = -recognizer.velocity() as _;
|
||||||
let gesture_event = EventWrapper::StaticEvent(Event::WindowEvent {
|
let gesture_event = EventWrapper::StaticEvent(Event::WindowEvent {
|
||||||
window_id: RootWindowId(window.id()),
|
window_id: RootWindowId(window.id()),
|
||||||
event: WindowEvent::RotationGesture {
|
event: WindowEvent::RotationGesture {
|
||||||
device_id: DEVICE_ID,
|
device_id: DEVICE_ID,
|
||||||
delta: recognizer.velocity() as _,
|
delta,
|
||||||
phase,
|
phase,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue