Skip to content

Commit d4021ba

Browse files
committed
input: fix vertical scroll jitter on macOS touchpads
1 parent 34aec22 commit d4021ba

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

crates/edit/src/input.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,12 @@ impl<'input> Iterator for Stream<'_, '_, 'input> {
444444
mouse.state = InputMouseState::None;
445445
if (btn & 0x40) != 0 {
446446
mouse.state = InputMouseState::Scroll;
447-
mouse.scroll.y += if (btn & 0x01) != 0 { 3 } else { -3 };
447+
match btn & 0x03 {
448+
0 => mouse.scroll.y -= 3,
449+
1 => mouse.scroll.y += 3,
450+
2 | 3 => {}
451+
_ => unreachable!(),
452+
}
448453
} else if csi.final_byte == 'M' {
449454
const STATES: [InputMouseState; 4] = [
450455
InputMouseState::Left,

0 commit comments

Comments
 (0)