Fix scrolling too fast on selection for editor and terminal (#28309)

This commit is contained in:
Smit Barmase 2025-04-08 12:16:18 +05:30 committed by GitHub
parent 1264e7a200
commit 3b787e85a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -8404,7 +8404,7 @@ enum CursorPopoverType {
}
pub fn scale_vertical_mouse_autoscroll_delta(delta: Pixels) -> f32 {
(delta.pow(1.5) / 100.0).into()
(delta.pow(1.2) / 100.0).min(px(3.0)).into()
}
fn scale_horizontal_mouse_autoscroll_delta(delta: Pixels) -> f32 {

View file

@ -1590,7 +1590,7 @@ impl Terminal {
return None;
};
Some(scroll_lines)
Some(scroll_lines.clamp(-3, 3))
}
pub fn mouse_down(&mut self, e: &MouseDownEvent, _cx: &mut Context<Self>) {