FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    MediaExtensions

    struct · ferroui-base · v0.5.0

    struct MediaExtensions
    

    Provides extension methods for media types.

    View source

    Members

    calculate_scaling

    fn calculate_scaling(stretch: Stretch, destination_size: Size, source_size: Size, stretch_direction: StretchDirection) -> Vector
    

    Calculates scaling based on a Stretch value.

    • stretch - The stretch mode.
    • destination_size - The size of the destination viewport.
    • source_size - The size of the source.
    • stretch_direction - The stretch direction (upstream default: StretchDirection::Both).

    Returns a vector with the X and Y scaling factors.

    Source

    calculate_size

    fn calculate_size(stretch: Stretch, destination_size: Size, source_size: Size, stretch_direction: StretchDirection) -> Size
    

    Calculates a scaled size based on a Stretch value.

    • stretch - The stretch mode.
    • destination_size - The size of the destination viewport.
    • source_size - The size of the source.
    • stretch_direction - The stretch direction (upstream default: StretchDirection::Both).

    Returns the size of the stretched source.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ErasedDestructor
    • IntoEither

    Availability

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