Scroll box example

This commit is contained in:
2026-03-21 04:05:38 -04:00
parent a70a08297e
commit ac9be932e7
6 changed files with 1507 additions and 278 deletions

View File

@@ -1556,6 +1556,23 @@ impl Dispatch<wl_pointer::WlPointer, ()> for State {
.pending_pointer_events
.push(PointerEvent::new(0, position, kind));
}
wl_pointer::Event::Axis { axis, value, .. } => {
let Some(position) = state.pointer_position else {
return;
};
let delta = match axis {
WEnum::Value(wl_pointer::Axis::VerticalScroll) => Point::new(0.0, value as f32),
WEnum::Value(wl_pointer::Axis::HorizontalScroll) => {
Point::new(value as f32, 0.0)
}
WEnum::Value(_) | WEnum::Unknown(_) => return,
};
state.pending_pointer_events.push(PointerEvent::new(
0,
position,
PointerEventKind::Scroll { delta },
));
}
_ => {}
}
}