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

Method scrollhmove

src/elements/scrollable.rs:225–233  ·  view source on GitHub ↗
(&self, e: &MouseEvent, _: f32)

Source from the content-addressed store, hash-verified

223 }
224
225 fn scrollhmove(&self, e: &MouseEvent, _: f32) {
226 let mut state = self.state.borrow_mut();
227 if state.drag_h && state.visible_h {
228 let _dest =
229 (e.x as f32 - state.drag_x).clamp(self.x(), self.right() - self.scrollh.w());
230 state.percent_h = (_dest - self.x()) / (self.w() - self.scrollh.w());
231 self.update_scroll();
232 } //drag_h
233 }
234
235 //Refresh all relevant values
236

Callers

nothing calls this directly

Calls 4

rightMethod · 0.80
xMethod · 0.45
wMethod · 0.45
update_scrollMethod · 0.45

Tested by

no test coverage detected