Switch to WheelHiRes. Add horizontal scrolling (#171)

* Switch to HiResScroll. Add horizontal scrolling

* Fix OpenVR compilation for horizontal scrolling

* fix OpenXR scroll using x axis for both scroll axes
This commit is contained in:
AdiMCS
2025-03-09 10:20:10 -07:00
committed by GitHub
parent 36074307b7
commit b0883e81bf
14 changed files with 77 additions and 60 deletions

View File

@@ -267,13 +267,13 @@ impl<D, S> InteractionHandler for Canvas<D, S> {
}
}
}
fn on_scroll(&mut self, app: &mut AppState, hit: &PointerHit, delta: f32) {
fn on_scroll(&mut self, app: &mut AppState, hit: &PointerHit, delta_y: f32, delta_x: f32) {
let idx = self.hover_controls[hit.pointer];
if let Some(idx) = idx {
let c = &mut self.controls[idx];
if let Some(ref mut f) = c.on_scroll {
f(c, &mut self.canvas.data, app, delta);
f(c, &mut self.canvas.data, app, delta_y, delta_x);
}
}
}