From ef2ec904ceb7f29f597bece94dad538ab95fc2c2 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Thu, 25 Jan 2024 23:46:48 +0100 Subject: [PATCH] Fix iOS gesture deltas (#3426) --- src/platform_impl/ios/view.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/platform_impl/ios/view.rs b/src/platform_impl/ios/view.rs index 80d64260a1..0f6a677799 100644 --- a/src/platform_impl/ios/view.rs +++ b/src/platform_impl/ios/view.rs @@ -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, }, });