mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-11 13:51:01 -05:00
parent
27bf9885ec
commit
22fa4260fc
2 changed files with 8 additions and 3 deletions
|
@ -145,7 +145,8 @@ pub struct Mouse {
|
|||
pub scroll_px: i32,
|
||||
pub line: Line,
|
||||
pub column: Column,
|
||||
pub cell_side: Side
|
||||
pub cell_side: Side,
|
||||
pub lines_scrolled: f32,
|
||||
}
|
||||
|
||||
impl Default for Mouse {
|
||||
|
@ -160,6 +161,7 @@ impl Default for Mouse {
|
|||
line: Line(0),
|
||||
column: Column(0),
|
||||
cell_side: Side::Left,
|
||||
lines_scrolled: 0.0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -352,15 +352,18 @@ impl<'a, A: ActionContext + 'a> Processor<'a, A> {
|
|||
|
||||
match delta {
|
||||
MouseScrollDelta::LineDelta(_columns, lines) => {
|
||||
let code = if lines > 0.0 {
|
||||
let to_scroll = self.ctx.mouse_mut().lines_scrolled + lines;
|
||||
|
||||
let code = if to_scroll > 0.0 {
|
||||
64
|
||||
} else {
|
||||
65
|
||||
};
|
||||
|
||||
for _ in 0..(lines.abs() as usize) {
|
||||
for _ in 0..(to_scroll.abs() as usize) {
|
||||
self.normal_mouse_report(code);
|
||||
}
|
||||
self.ctx.mouse_mut().lines_scrolled = to_scroll % 1.0;
|
||||
},
|
||||
MouseScrollDelta::PixelDelta(_x, y) => {
|
||||
match phase {
|
||||
|
|
Loading…
Reference in a new issue