mirror of https://github.com/wayvr-org/wayvr.git
Fix scrolling for all Electron-based applications
This commit is contained in:
parent
ee3fbff44c
commit
b6a07c43a5
|
|
@ -366,10 +366,18 @@ where
|
|||
);
|
||||
}
|
||||
|
||||
let haptics = hovered.backend.on_hover(app, &hit);
|
||||
let scroll_threshold = 0.1;
|
||||
let mut haptics: Option<Haptics> = None;
|
||||
|
||||
// Pass mouse motion events only if not scrolling
|
||||
// (allows scrolling on all Chromium-based applications)
|
||||
if app.input_state.pointers[idx].now.scroll.abs() <= scroll_threshold {
|
||||
haptics = hovered.backend.on_hover(app, &hit);
|
||||
}
|
||||
|
||||
pointer = &mut app.input_state.pointers[idx];
|
||||
|
||||
if pointer.now.scroll.abs() > 0.1 {
|
||||
if pointer.now.scroll.abs() > scroll_threshold {
|
||||
let scroll = pointer.now.scroll;
|
||||
if app.input_state.pointers[1 - idx]
|
||||
.interaction
|
||||
|
|
|
|||
Loading…
Reference in New Issue