Skip to content

Commit

Permalink
Fix vertical scroll for TextEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Sep 21, 2023
1 parent 7373dd8 commit 68d4945
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions widget/src/text_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,9 @@ impl Update {
action(Action::Scroll {
lines: match delta {
mouse::ScrollDelta::Lines { y, .. } => {
if y > 0.0 {
-(y * 4.0).min(1.0) as i32
if y.abs() > 0.0 {
(y.signum() * -(y.abs() * 4.0).max(1.0))
as i32
} else {
0
}
Expand Down

0 comments on commit 68d4945

Please sign in to comment.