mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-25 06:41:31 +11:00
Fix wayland vertical scroll sign
This commit is contained in:
parent
506e830cb0
commit
58b800c344
|
@ -455,7 +455,8 @@ impl wl_pointer::Handler for InputHandler {
|
||||||
{
|
{
|
||||||
let (mut x, mut y) = self.axis_buffer.unwrap_or((0.0, 0.0));
|
let (mut x, mut y) = self.axis_buffer.unwrap_or((0.0, 0.0));
|
||||||
match axis {
|
match axis {
|
||||||
wl_pointer::Axis::VerticalScroll => y += value as f32,
|
// wayland vertical sign convention is the inverse of winit
|
||||||
|
wl_pointer::Axis::VerticalScroll => y -= value as f32,
|
||||||
wl_pointer::Axis::HorizontalScroll => x += value as f32
|
wl_pointer::Axis::HorizontalScroll => x += value as f32
|
||||||
}
|
}
|
||||||
self.axis_buffer = Some((x,y));
|
self.axis_buffer = Some((x,y));
|
||||||
|
@ -518,7 +519,8 @@ impl wl_pointer::Handler for InputHandler {
|
||||||
{
|
{
|
||||||
let (mut x, mut y) = self.axis_discrete_buffer.unwrap_or((0,0));
|
let (mut x, mut y) = self.axis_discrete_buffer.unwrap_or((0,0));
|
||||||
match axis {
|
match axis {
|
||||||
wl_pointer::Axis::VerticalScroll => y += discrete,
|
// wayland vertical sign convention is the inverse of winit
|
||||||
|
wl_pointer::Axis::VerticalScroll => y -= discrete,
|
||||||
wl_pointer::Axis::HorizontalScroll => x += discrete
|
wl_pointer::Axis::HorizontalScroll => x += discrete
|
||||||
}
|
}
|
||||||
self.axis_discrete_buffer = Some((x,y));
|
self.axis_discrete_buffer = Some((x,y));
|
||||||
|
|
Loading…
Reference in a new issue