mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 07:03:15 -04:00
Fix iOS gesture deltas (#3426)
This commit is contained in:
@@ -182,13 +182,11 @@ declare_class!(
|
||||
state => panic!("unexpected recognizer state: {:?}", state),
|
||||
};
|
||||
|
||||
// Flip the velocity to match macOS.
|
||||
let delta = -recognizer.velocity() as _;
|
||||
let gesture_event = EventWrapper::StaticEvent(Event::WindowEvent {
|
||||
window_id: RootWindowId(window.id()),
|
||||
event: WindowEvent::PinchGesture {
|
||||
device_id: DEVICE_ID,
|
||||
delta,
|
||||
delta: recognizer.velocity() as _,
|
||||
phase,
|
||||
},
|
||||
});
|
||||
@@ -228,11 +226,13 @@ declare_class!(
|
||||
state => panic!("unexpected recognizer state: {:?}", state),
|
||||
};
|
||||
|
||||
// Flip the velocity to match macOS.
|
||||
let delta = -recognizer.velocity() as _;
|
||||
let gesture_event = EventWrapper::StaticEvent(Event::WindowEvent {
|
||||
window_id: RootWindowId(window.id()),
|
||||
event: WindowEvent::RotationGesture {
|
||||
device_id: DEVICE_ID,
|
||||
delta: recognizer.velocity() as _,
|
||||
delta,
|
||||
phase,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user