Allow relative mouse movement to be negative
This commit is contained in:
parent
ae41584db9
commit
81375a085f
|
@ -239,22 +239,22 @@ impl PointerAxisEvent for UnusedEvent {
|
||||||
/// Trait for pointer events generated by relative device movement.
|
/// Trait for pointer events generated by relative device movement.
|
||||||
pub trait PointerMotionEvent: Event {
|
pub trait PointerMotionEvent: Event {
|
||||||
/// Delta between the last and new pointer device position interpreted as pixel movement
|
/// 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())
|
(self.delta_x(), self.delta_y())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Delta on the x axis between the last and new pointer device position interpreted as pixel movement
|
/// 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
|
/// 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 {
|
impl PointerMotionEvent for UnusedEvent {
|
||||||
fn delta_x(&self) -> u32 {
|
fn delta_x(&self) -> i32 {
|
||||||
match *self {}
|
match *self {}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn delta_y(&self) -> u32 {
|
fn delta_y(&self) -> i32 {
|
||||||
match *self {}
|
match *self {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,11 +133,11 @@ impl backend::Event for event::pointer::PointerMotionEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl backend::PointerMotionEvent for event::pointer::PointerMotionEvent {
|
impl backend::PointerMotionEvent for event::pointer::PointerMotionEvent {
|
||||||
fn delta_x(&self) -> u32 {
|
fn delta_x(&self) -> i32 {
|
||||||
self.dx() as u32
|
self.dx() as i32
|
||||||
}
|
}
|
||||||
fn delta_y(&self) -> u32 {
|
fn delta_y(&self) -> i32 {
|
||||||
self.dy() as u32
|
self.dy() as i32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue