input: fix scroll-factor resetting if unspecified

This commit is contained in:
Alex Mirrlees-Black 2024-04-23 23:28:42 +10:00
parent 5fbf174c36
commit bd5da261eb

View File

@ -256,7 +256,9 @@ pub const ScrollFactor = struct {
value: ?f32 = null, value: ?f32 = null,
fn apply(scroll_factor: ScrollFactor, device: *InputDevice) void { fn apply(scroll_factor: ScrollFactor, device: *InputDevice) void {
device.config.scroll_factor = scroll_factor.value orelse 1.0; if (scroll_factor.value) |value| {
device.config.scroll_factor = value;
}
} }
}; };