Skip to main content

thumb

Function thumb 

Source
pub fn thumb(
    viewport: Pixels,
    max_offset: Pixels,
    offset: Pixels,
    min: Pixels,
) -> Option<Range<Pixels>>
Expand description

Where the thumb sits in a track of viewport length, as a range from the track’s start — or None when there is nothing to scroll.

None also covers a viewport of zero (the frame before layout has run) and a thumb that would not fit, which is zed’s third guard: with a viewport shorter than MIN_THUMB a bar would be all thumb and no travel.