Skip to content

Commit

Permalink
Fix iOS gesture deltas (#3426)
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm authored Jan 25, 2024
1 parent 98d3391 commit ef2ec90
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/platform_impl/ios/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
});
Expand Down Expand Up @@ -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,
},
});
Expand Down

0 comments on commit ef2ec90

Please sign in to comment.