Skip to content

Commit

Permalink
Unwrap axis id in raw mouse motion on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
swiftcoder committed Jul 29, 2017
1 parent 6820e2a commit 15c4641
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/platform/macos/events_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use std::sync::{Arc, Mutex, Weak};
use super::window::Window;
use std;
use super::DeviceId;
use AxisId;


pub struct EventsLoop {
Expand Down Expand Up @@ -481,14 +480,14 @@ impl EventsLoop {

let delta_x = (scale_factor * ns_event.deltaX() as f32) as f64;
if delta_x != 0.0 {
let motion_event = DeviceEvent::Motion { axis: AxisId(0), value: delta_x };
let motion_event = DeviceEvent::Motion { axis: 0, value: delta_x };
let event = Event::DeviceEvent{ device_id: DEVICE_ID, event: motion_event };
events.push_back(event);
}

let delta_y = (scale_factor * ns_event.deltaY() as f32) as f64;
if delta_y != 0.0 {
let motion_event = DeviceEvent::Motion { axis: AxisId(1), value: delta_y };
let motion_event = DeviceEvent::Motion { axis: 1, value: delta_y };
let event = Event::DeviceEvent{ device_id: DEVICE_ID, event: motion_event };
events.push_back(event);
}
Expand Down

0 comments on commit 15c4641

Please sign in to comment.