Increase scroll-speed on glium from 8 to 50 points per scroll tick
Closes https://github.com/emilk/egui/issues/461 Closes https://github.com/emilk/egui/pull/702
This commit is contained in:
parent
aef23753ca
commit
249876523d
5 changed files with 14 additions and 10 deletions
|
@ -4,6 +4,7 @@ All notable changes to the `eframe` crate.
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
* Remove "http" feature (use https://github.com/emilk/ehttp instead!).
|
* Remove "http" feature (use https://github.com/emilk/ehttp instead!).
|
||||||
|
* Increase scroll speed.
|
||||||
|
|
||||||
|
|
||||||
## 0.14.0 - 2021-08-24
|
## 0.14.0 - 2021-08-24
|
||||||
|
|
|
@ -7,6 +7,8 @@ All notable changes to the `egui_glium` integration will be noted in this file.
|
||||||
* Remove "http" feature (use https://github.com/emilk/ehttp instead!).
|
* Remove "http" feature (use https://github.com/emilk/ehttp instead!).
|
||||||
* Add `epi::NativeTexture` trait for glium painter
|
* Add `epi::NativeTexture` trait for glium painter
|
||||||
* Deprecate 'Painter::register_glium_texture'
|
* Deprecate 'Painter::register_glium_texture'
|
||||||
|
* Increase scroll speed.
|
||||||
|
|
||||||
|
|
||||||
## 0.14.0 - 2021-08-24
|
## 0.14.0 - 2021-08-24
|
||||||
* Fix native file dialogs hanging (eg. when using [`rfd`](https://github.com/PolyMeilex/rfd)).
|
* Fix native file dialogs hanging (eg. when using [`rfd`](https://github.com/PolyMeilex/rfd)).
|
||||||
|
|
|
@ -251,8 +251,8 @@ pub fn input_to_egui(
|
||||||
WindowEvent::MouseWheel { delta, .. } => {
|
WindowEvent::MouseWheel { delta, .. } => {
|
||||||
let mut delta = match *delta {
|
let mut delta = match *delta {
|
||||||
glutin::event::MouseScrollDelta::LineDelta(x, y) => {
|
glutin::event::MouseScrollDelta::LineDelta(x, y) => {
|
||||||
let line_height = 8.0; // magic value!
|
let points_per_scroll_line = 50.0; // Scroll speed decided by consensus: https://github.com/emilk/egui/issues/461
|
||||||
vec2(x, y) * line_height
|
vec2(x, y) * points_per_scroll_line
|
||||||
}
|
}
|
||||||
glutin::event::MouseScrollDelta::PixelDelta(delta) => {
|
glutin::event::MouseScrollDelta::PixelDelta(delta) => {
|
||||||
vec2(delta.x as f32, delta.y as f32) / pixels_per_point
|
vec2(delta.x as f32, delta.y as f32) / pixels_per_point
|
||||||
|
|
|
@ -4,21 +4,22 @@ All notable changes to the `egui_web` integration will be noted in this file.
|
||||||
|
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
* Remove "http" feature (use https://github.com/emilk/ehttp instead!).
|
* Remove "http" feature (use https://github.com/emilk/ehttp instead!).
|
||||||
* `epi::NativeTexture` trait for webgl1 webgl2 painter
|
* `epi::NativeTexture` trait for webgl1 webgl2 painter
|
||||||
* Deprecate `Painter::register_webgl_texture`
|
* Deprecate `Painter::register_webgl_texture`
|
||||||
|
|
||||||
|
### Changed 🔧
|
||||||
|
* Increase scroll speed.
|
||||||
|
|
||||||
|
|
||||||
## 0.14.1 - 2021-08-28
|
## 0.14.1 - 2021-08-28
|
||||||
|
|
||||||
### Fixed 🐛
|
### Fixed 🐛
|
||||||
* Fix alpha blending for WebGL2 and WebGL1 with sRGB support backends, now having identical results as egui_glium.
|
* Fix alpha blending for WebGL2 and WebGL1 with sRGB support backends, now having identical results as egui_glium.
|
||||||
* Fix use of egui on devices with both touch and mouse.
|
* Fix use of egui on devices with both touch and mouse.
|
||||||
|
|
||||||
|
|
||||||
## 0.14.0 - 2021-08-24
|
## 0.14.0 - 2021-08-24
|
||||||
|
|
||||||
### Added ⭐
|
### Added ⭐
|
||||||
* Added support for dragging and dropping files into the browser window.
|
* Added support for dragging and dropping files into the browser window.
|
||||||
|
|
||||||
|
@ -27,7 +28,6 @@ All notable changes to the `egui_web` integration will be noted in this file.
|
||||||
|
|
||||||
|
|
||||||
## 0.13.0 - 2021-06-24
|
## 0.13.0 - 2021-06-24
|
||||||
|
|
||||||
### Changed 🔧
|
### Changed 🔧
|
||||||
* Default to light visuals unless the system reports a preference for dark mode.
|
* Default to light visuals unless the system reports a preference for dark mode.
|
||||||
|
|
||||||
|
@ -37,19 +37,18 @@ All notable changes to the `egui_web` integration will be noted in this file.
|
||||||
|
|
||||||
|
|
||||||
## 0.12.0 - 2021-05-10
|
## 0.12.0 - 2021-05-10
|
||||||
|
|
||||||
### Fixed 🐛
|
### Fixed 🐛
|
||||||
* Scroll faster when scrolling with mouse wheel.
|
* Scroll faster when scrolling with mouse wheel.
|
||||||
|
|
||||||
|
|
||||||
## 0.11.0 - 2021-04-05
|
## 0.11.0 - 2021-04-05
|
||||||
|
|
||||||
### Added ⭐
|
### Added ⭐
|
||||||
* [Fix mobile and IME text input](https://github.com/emilk/egui/pull/253)
|
* [Fix mobile and IME text input](https://github.com/emilk/egui/pull/253)
|
||||||
* Hold down a modifier key when clicking a link to open it in a new tab.
|
* Hold down a modifier key when clicking a link to open it in a new tab.
|
||||||
|
|
||||||
Contributors: [n2](https://github.com/n2)
|
Contributors: [n2](https://github.com/n2)
|
||||||
|
|
||||||
|
|
||||||
## 0.10.0 - 2021-02-28
|
## 0.10.0 - 2021-02-28
|
||||||
### Added ⭐
|
### Added ⭐
|
||||||
* You can control the maximum egui canvas size with `App::max_size_points`.
|
* You can control the maximum egui canvas size with `App::max_size_points`.
|
||||||
|
@ -90,6 +89,7 @@ Contributors: [n2](https://github.com/n2)
|
||||||
* Set a maximum canvas size to alleviate performance issues on some machines
|
* Set a maximum canvas size to alleviate performance issues on some machines
|
||||||
* Simplify `egui_web::start` arguments
|
* Simplify `egui_web::start` arguments
|
||||||
|
|
||||||
|
|
||||||
## 0.4.0 - 2020-11-28
|
## 0.4.0 - 2020-11-28
|
||||||
### Added ⭐
|
### Added ⭐
|
||||||
* A simple HTTP fetch API (wraps `web_sys`).
|
* A simple HTTP fetch API (wraps `web_sys`).
|
||||||
|
|
|
@ -1048,7 +1048,8 @@ fn install_canvas_events(runner_ref: &AppRunnerRef) -> Result<(), JsValue> {
|
||||||
canvas_size_in_points(runner_ref.0.lock().canvas_id()).y
|
canvas_size_in_points(runner_ref.0.lock().canvas_id()).y
|
||||||
}
|
}
|
||||||
web_sys::WheelEvent::DOM_DELTA_LINE => {
|
web_sys::WheelEvent::DOM_DELTA_LINE => {
|
||||||
8.0 // magic value!
|
let points_per_scroll_line = 50.0; // Scroll speed decided by consensus: https://github.com/emilk/egui/issues/461
|
||||||
|
points_per_scroll_line
|
||||||
}
|
}
|
||||||
_ => 1.0,
|
_ => 1.0,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue