Skip to main content

offset_for_thumb

Function offset_for_thumb 

Source
pub fn offset_for_thumb(
    top: Pixels,
    viewport: Pixels,
    max_offset: Pixels,
    size: Pixels,
) -> Pixels
Expand description

The inverse: the scroll offset that puts the thumb’s top at top.

Negative, because that is the direction gpui counts in, and clamped to the scrollable range so a drag past either end simply stops.