diff options
author | 2023-09-21 06:13:08 +0200 | |
---|---|---|
committer | 2023-09-21 06:15:12 +0200 | |
commit | 7373dd856b8837c2d91067b45e43b8f0e767c917 (patch) | |
tree | 576b67a588769645fe915f925f9ef8c95ee625c2 /widget/src/text_editor.rs | |
parent | da5dd2526a2d9ee27e9405ed19c0f7a641160c54 (diff) | |
download | iced-7373dd856b8837c2d91067b45e43b8f0e767c917.tar.gz iced-7373dd856b8837c2d91067b45e43b8f0e767c917.tar.bz2 iced-7373dd856b8837c2d91067b45e43b8f0e767c917.zip |
Scroll at least one line on macOS in `TextEditor`
Diffstat (limited to 'widget/src/text_editor.rs')
-rw-r--r-- | widget/src/text_editor.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index ac927fbc..76f3cc18 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -545,7 +545,11 @@ impl Update { action(Action::Scroll { lines: match delta { mouse::ScrollDelta::Lines { y, .. } => { - -y.round() as i32 * 4 + if y > 0.0 { + -(y * 4.0).min(1.0) as i32 + } else { + 0 + } } mouse::ScrollDelta::Pixels { y, .. } => { -y.signum() as i32 |