Skip to main content

needs_scrolling

Function needs_scrolling 

Source
pub fn needs_scrolling(
    bounding_box: (f64, f64, f64, f64),
    viewport_height: f64,
    threshold_percent: f64,
) -> bool
Expand description

Calculate if scrolling is needed to center an element.

§Arguments

  • bounding_box - The element’s bounding box (x, y, width, height)
  • viewport_height - The viewport height
  • threshold_percent - Percentage of viewport height to consider “significant”

§Returns

true if scrolling is needed