Skip to content

Commit

Permalink
Fix horizontal scrolling direction on Linux
Browse files Browse the repository at this point in the history
Closes #356

Work-around until rust-windowing/winit#2105 is merged and released
  • Loading branch information
emilk committed Jan 16, 2022
1 parent ad54187 commit c713fd9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions eframe/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ NOTE: [`egui_web`](egui_web/CHANGELOG.md), [`egui-winit`](egui-winit/CHANGELOG.m
* Removed `Frame::alloc_texture`. Use `egui::Context::load_texture` instead ([#1110](https://github.com/emilk/egui/pull/1110)).
* The default native backend is now `egui_glow` (instead of `egui_glium`) ([#1020](https://github.com/emilk/egui/pull/1020)).
* The default web painter is now `egui_glow` (instead of WebGL) ([#1020](https://github.com/emilk/egui/pull/1020)).
* Fix horizontal scrolling direction on Linux.


## 0.16.0 - 2021-12-29
Expand Down
1 change: 1 addition & 0 deletions egui-winit/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ All notable changes to the `egui-winit` integration will be noted in this file.


## Unreleased
* Fix horizontal scrolling direction on Linux.
* Replaced `std::time::Instant` with `instant::Instant` for WebAssembly compatability ([#1023](https://github.com/emilk/egui/pull/1023))


Expand Down
8 changes: 2 additions & 6 deletions egui-winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,8 @@ impl State {
egui::vec2(delta.x as f32, delta.y as f32) / self.pixels_per_point()
}
};
if cfg!(target_os = "macos") {
delta.x *= -1.0; // until https://github.com/rust-windowing/winit/pull/2105 is merged and released
}
if cfg!(target_os = "windows") {
delta.x *= -1.0; // until https://github.com/rust-windowing/winit/pull/2101 is merged and released
}

delta.x *= -1.0; // Winit has inverted hscroll. Remove this line when we update winit after https://github.com/rust-windowing/winit/pull/2105 is merged and released

if self.egui_input.modifiers.ctrl || self.egui_input.modifiers.command {
// Treat as zoom instead:
Expand Down

0 comments on commit c713fd9

Please sign in to comment.