mirror of
https://github.com/pinnacle-comp/pinnacle.git
synced 2025-01-13 08:01:05 +01:00
Reverse scroll direction on winit
This commit is contained in:
parent
aaf2921363
commit
7f5d9e431c
2 changed files with 13 additions and 1 deletions
|
@ -423,10 +423,14 @@ impl State {
|
|||
.amount(Axis::Horizontal)
|
||||
.unwrap_or_else(|| event.amount_discrete(Axis::Horizontal).unwrap_or(0.0) * 3.0);
|
||||
|
||||
let vertical_amount = event
|
||||
let mut vertical_amount = event
|
||||
.amount(Axis::Vertical)
|
||||
.unwrap_or_else(|| event.amount_discrete(Axis::Vertical).unwrap_or(0.0) * 3.0);
|
||||
|
||||
if self.backend.is_winit() {
|
||||
vertical_amount = -vertical_amount;
|
||||
}
|
||||
|
||||
let horizontal_amount_discrete = event.amount_discrete(Axis::Horizontal);
|
||||
let vertical_amount_discrete = event.amount_discrete(Axis::Vertical);
|
||||
|
||||
|
|
|
@ -87,6 +87,14 @@ impl Backend {
|
|||
Backend::Udev(udev) => udev.early_import(surface),
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns `true` if the backend is [`Winit`].
|
||||
///
|
||||
/// [`Winit`]: Backend::Winit
|
||||
#[must_use]
|
||||
pub fn is_winit(&self) -> bool {
|
||||
matches!(self, Self::Winit(..))
|
||||
}
|
||||
}
|
||||
|
||||
/// The main state of the application.
|
||||
|
|
Loading…
Reference in a new issue