mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
Reformat scroll factor computation
This commit is contained in:
+3
-2
@@ -2571,13 +2571,14 @@ impl State {
|
|||||||
AxisSource::Finger => self.niri.config.borrow().input.touchpad.scroll_factor,
|
AxisSource::Finger => self.niri.config.borrow().input.touchpad.scroll_factor,
|
||||||
_ => None,
|
_ => None,
|
||||||
};
|
};
|
||||||
|
let scroll_factor = scroll_factor.map(|x| x.0).unwrap_or(1.);
|
||||||
|
|
||||||
let window_scroll_factor = pointer
|
let window_scroll_factor = pointer
|
||||||
.current_focus()
|
.current_focus()
|
||||||
.map(|focused| self.niri.find_root_shell_surface(&focused))
|
.map(|focused| self.niri.find_root_shell_surface(&focused))
|
||||||
.and_then(|root| self.niri.layout.find_window_and_output(&root).unzip().0)
|
.and_then(|root| self.niri.layout.find_window_and_output(&root).unzip().0)
|
||||||
.and_then(|window| window.rules().scroll_factor);
|
.and_then(|window| window.rules().scroll_factor);
|
||||||
let scroll_factor =
|
let scroll_factor = scroll_factor * window_scroll_factor.unwrap_or(1.);
|
||||||
scroll_factor.map(|x| x.0).unwrap_or(1.) * window_scroll_factor.unwrap_or(1.);
|
|
||||||
|
|
||||||
let horizontal_amount = horizontal_amount.unwrap_or_else(|| {
|
let horizontal_amount = horizontal_amount.unwrap_or_else(|| {
|
||||||
// Winit backend, discrete scrolling.
|
// Winit backend, discrete scrolling.
|
||||||
|
|||||||
Reference in New Issue
Block a user