Fix vertical scroll for TextEditor

This commit is contained in:
Héctor Ramón Jiménez 2023-09-21 06:17:47 +02:00
parent 7373dd856b
commit 68d49459ce
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -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
}