FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    KeySpline

    struct · ferroui-base · v0.5.0

    struct KeySpline
    

    Determines how an animation is used based on a cubic bezier curve. X1 and X2 must be between 0.0 and 1.0, inclusive.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<KeySpline>
    

    Returns a strong reference to this object.

    Source

    construct

    fn construct(x1: f64, y1: f64, x2: f64, y2: f64) -> Self
    

    Creates the class data; see FerroObject::construct.

    Source

    new

    fn new() -> Ref<Self>
    

    Creates a key spline with the default control points (0, 0) and (1, 1).

    Source

    with_points

    fn with_points(x1: f64, y1: f64, x2: f64, y2: f64) -> Ref<Self>
    

    Creates a key spline with the given control points. The points are not validated here; see is_valid.

    Source

    parse

    fn parse(value: &str) -> Result<Ref<KeySpline>, FormatError>
    

    Parses a key spline from four numbers.

    Source

    control_point_x1

    fn control_point_x1(self: &Self) -> f64
    

    X coordinate of the first control point.

    Source

    set_control_point_x1

    fn set_control_point_x1(self: &Self, value: f64)
    

    Sets the X coordinate of the first control point. Panics when the value is outside [0, 1].

    Source

    control_point_y1

    fn control_point_y1(self: &Self) -> f64
    

    Y coordinate of the first control point.

    Source

    set_control_point_y1

    fn set_control_point_y1(self: &Self, value: f64)
    

    Source

    control_point_x2

    fn control_point_x2(self: &Self) -> f64
    

    X coordinate of the second control point.

    Source

    set_control_point_x2

    fn set_control_point_x2(self: &Self, value: f64)
    

    Sets the X coordinate of the second control point. Panics when the value is outside [0, 1].

    Source

    control_point_y2

    fn control_point_y2(self: &Self) -> f64
    

    Y coordinate of the second control point.

    Source

    set_control_point_y2

    fn set_control_point_y2(self: &Self, value: f64)
    

    Source

    get_spline_progress

    fn get_spline_progress(self: &Self, linear_progress: f64) -> f64
    

    Calculates the spline progress from a linear progress.

    Source

    is_valid

    fn is_valid(self: &Self) -> bool
    

    Checks whether the spline control points are valid: both X values within [0, 1].

    Source

    Trait implementations

    Availability

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