pub fn content_step(content: Option<f64>, visible: Option<f64>) -> StepExpand description
The per-line scroll step computed from the document content’s size along the scroll axis and the visible viewport’s size along the same axis.
content is the size of the scroll area’s document child — the first
AXChildren element that is not an AXScrollBar (typically
AXTextArea, AXTable, AXOutline, or AXGroup). visible is the
scroll area’s own AXSize along the axis, minus the orthogonal scroll
bar’s height (or width) when both bars are present.
One wheel notch is LINE_POINTS points (≈ three text lines), so one
wheel line moves LINE_POINTS / (content - visible) of the bar, clamped
to 0..=1. The unit tests pin every branch:
Some(2400), Some(400)→0.02so ten wheel lines move0.2of the bar.content <= visible→0.0withCONTENT_FITS_WARNING(nothing to scroll).- missing or non-finite sizes →
DEFAULT_STEPwithAPPROXIMATED_WARNING(we did not measure, so the step is a guess).