Skip to content

Commit

Permalink
Update input_state.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
rustbasic authored Apr 25, 2024
1 parent cd3908f commit ee8882d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/egui/src/input_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,11 @@ impl InputState {
self.smooth_scroll_delta[d] += self.unprocessed_scroll_delta[d];
self.unprocessed_scroll_delta[d] = 0.0;
} else {
let smooth_delta = t * self.unprocessed_scroll_delta[d]; // For Smooth
let direct_delta = self.unprocessed_scroll_delta[d]; // For Direct
let smooth_delta = t * self.unprocessed_scroll_delta[d]; // For Smooth
let direct_delta = self.unprocessed_scroll_delta[d]; // For Direct
let delta = match smooth_delta > 0.0 {
true => smooth_delta.min(direct_delta), // min : Smooth, max : Direct
false => smooth_delta.max(direct_delta), // max : Smooth, min : Direct
true => smooth_delta.min(direct_delta), // min : Smooth, max : Direct
false => smooth_delta.max(direct_delta), // max : Smooth, min : Direct
};
self.smooth_scroll_delta[d] += delta;
self.unprocessed_scroll_delta[d] -= delta;
Expand Down

0 comments on commit ee8882d

Please sign in to comment.