MCPcopy Create free account
hub / github.com/angular-rust/ux-components / mousewheel

Method mousewheel

src/elements/scrollable.rs:325–344  ·  view source on GitHub ↗
(&self, e: &mut MouseEvent)

Source from the content-addressed store, hash-verified

323 }
324
325 fn mousewheel(&self, e: &mut MouseEvent) {
326 let state = self.state.borrow();
327 // self.base.mousewheel(e);
328
329 if e.x != 0 && state.visible_h {
330 let dir = Helper::sign(e.x as f32) as f32;
331 self.set_scroll_percent(
332 Some(state.percent_h + (dir * self.step_h())),
333 Some(state.percent_v),
334 );
335 }
336
337 if e.y != 0 && state.visible_v {
338 let dir = Helper::sign(e.y as f32) as f32;
339 self.set_scroll_percent(
340 Some(state.percent_h),
341 Some(state.percent_v + (dir * self.step_v())),
342 );
343 }
344 }
345
346 // _dx: f32 =0.0, _dy: f32 =0.0, _dw: f32 =0.0, _dh: f32 =0.0
347 fn bounds_changed(&self, dx: f32, dy: f32, dw: f32, dh: f32) {

Callers

nothing calls this directly

Calls 3

set_scroll_percentMethod · 0.45
step_hMethod · 0.45
step_vMethod · 0.45

Tested by

no test coverage detected