Skip to content

Commit

Permalink
Tweak scrolling pixels-per-logical-line to match browser behavior (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralith authored Nov 20, 2023
1 parent dd25aa7 commit 0556ed3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/yakui-winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ impl YakuiWinit {
event: WindowEvent::MouseWheel { delta, .. },
..
} => {
const LINE_HEIGHT: f32 = 90.0;
// Observed logical pixels per scroll wheel increment in Windows on Chrome
const LINE_HEIGHT: f32 = 100.0 / 3.0;

let delta = match *delta {
MouseScrollDelta::LineDelta(x, y) => Vec2::new(x, y) * LINE_HEIGHT,
Expand Down

0 comments on commit 0556ed3

Please sign in to comment.