pub fn compute_scrollbar_geometry(
orientation: ScrollbarOrientation,
inner_rect: LogicalRect,
content_size: LogicalSize,
scroll_offset: f32,
scrollbar_width_px: f32,
has_other_scrollbar: bool,
) -> ScrollbarGeometryExpand description
Compute scrollbar geometry for one axis.
This is the single source of truth for all scrollbar calculations. All consumers (display list painting, GPU transforms, hit-testing, drag) must use this function to ensure consistent geometry.
§Parameters
orientation: Vertical or horizontal scrollbarinner_rect: The padding-box (border-box minus borders) of the scroll container, in the container’s coordinate space (absolute window coordinates)content_size: Total content size (fromget_content_size()orvirtual_scroll_size)scroll_offset: Current scroll offset (y for vertical, x for horizontal; positive = scrolled)scrollbar_width_px: CSS-resolved scrollbar thickness in pixelshas_other_scrollbar: Whether the perpendicular scrollbar is also visible (reduces track length by onescrollbar_width_pxfor the corner)