Merge pull request #80 from Smithay/fix/relative_mouse_events
Allow relative mouse movement to be negative
This commit is contained in:
commit
e17ebbd9e7
|
@ -239,22 +239,22 @@ impl PointerAxisEvent for UnusedEvent {
|
|||
/// Trait for pointer events generated by relative device movement.
|
||||
pub trait PointerMotionEvent: Event {
|
||||
/// Delta between the last and new pointer device position interpreted as pixel movement
|
||||
fn delta(&self) -> (u32, u32) {
|
||||
fn delta(&self) -> (i32, i32) {
|
||||
(self.delta_x(), self.delta_y())
|
||||
}
|
||||
|
||||
/// Delta on the x axis between the last and new pointer device position interpreted as pixel movement
|
||||
fn delta_x(&self) -> u32;
|
||||
fn delta_x(&self) -> i32;
|
||||
/// Delta on the y axis between the last and new pointer device position interpreted as pixel movement
|
||||
fn delta_y(&self) -> u32;
|
||||
fn delta_y(&self) -> i32;
|
||||
}
|
||||
|
||||
impl PointerMotionEvent for UnusedEvent {
|
||||
fn delta_x(&self) -> u32 {
|
||||
fn delta_x(&self) -> i32 {
|
||||
match *self {}
|
||||
}
|
||||
|
||||
fn delta_y(&self) -> u32 {
|
||||
fn delta_y(&self) -> i32 {
|
||||
match *self {}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,11 +133,11 @@ impl backend::Event for event::pointer::PointerMotionEvent {
|
|||
}
|
||||
|
||||
impl backend::PointerMotionEvent for event::pointer::PointerMotionEvent {
|
||||
fn delta_x(&self) -> u32 {
|
||||
self.dx() as u32
|
||||
fn delta_x(&self) -> i32 {
|
||||
self.dx() as i32
|
||||
}
|
||||
fn delta_y(&self) -> u32 {
|
||||
self.dy() as u32
|
||||
fn delta_y(&self) -> i32 {
|
||||
self.dy() as i32
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue