FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    MaterialSheetAnchors

    struct · ferroui-themes-material · v0.5.0

    struct MaterialSheetAnchors
    

    Sheet top coordinates in a viewport, expressed in device-independent pixels.

    The partial and expanded coordinates may be equal. Do not use a map keyed by floating-point position to represent the semantic states: it loses information.

    View source

    Members

    hidden

    hidden: f64
    

    Source

    partially_expanded

    partially_expanded: f64
    

    Source

    expanded

    expanded: f64
    

    Source

    POSITIONAL_THRESHOLD

    const POSITIONAL_THRESHOLD: f64
    

    Source

    VELOCITY_THRESHOLD

    const VELOCITY_THRESHOLD: f64
    

    Source

    VELOCITY_DAMPING_ZONE

    const VELOCITY_DAMPING_ZONE: f64
    

    Source

    new

    fn new(viewport_height: f64, sheet_height: f64) -> Self
    

    Recomputes anchors for the current usable viewport and measured sheet. Nonfinite dimensions are treated as zero; oversized sheets fill the viewport.

    Source

    offset

    fn offset(self: Self, state: MaterialSheetState) -> f64
    

    Source

    partial_matches_expanded

    fn partial_matches_expanded(self: Self) -> bool
    

    Source

    reconcile_target

    fn reconcile_target(self: Self, previous: Self, target: MaterialSheetState, partial_enabled: bool) -> MaterialSheetState
    

    Preserves the fully visible short-sheet state when its content grows.

    Source

    settle_target

    fn settle_target(self: Self, current: MaterialSheetState, offset: f64, velocity: f64, partial_enabled: bool, allow_hidden: bool) -> MaterialSheetState
    

    Chooses an adjacent legal anchor using the source's 56dp / 125dp/s thresholds. A high-velocity fling follows its direction; a slow drag must cross the positional threshold from the last settled state. Large drags can traverse multiple anchors. allow_hidden=false is useful for persistent sheets.

    Source

    damp_velocity

    fn damp_velocity(self: Self, offset: f64, velocity: f64, maximum_velocity: f64) -> f64
    

    Damps downward fling energy in the source's 125dp hidden-boundary zone. The source preserves the fling threshold once it has already been crossed.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • ErasedDestructor
    • IntoEither
    • CastableFrom<ST, Uninit, Uninit>
    • CastableFrom<ST, Initialized, Initialized>
    • Read<Exclusive, BecauseExclusive>
    • Clone
    • Copy
    • Debug
    • Default
    • StructuralPartialEq
    • PartialEq

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.