Type Alias style::values::computed::easing::ComputedTimingFunction

source ·
pub type ComputedTimingFunction = TimingFunction<Integer, Number, PiecewiseLinearFunction>;
Expand description

A computed timing function.

Aliased Type§

enum ComputedTimingFunction {
    Keyword(TimingKeyword),
    CubicBezier {
        x1: f32,
        y1: f32,
        x2: f32,
        y2: f32,
    },
    Steps(i32, StepPosition),
    LinearFunction(PiecewiseLinearFunction),
}

Variants§

§

Keyword(TimingKeyword)

linear | ease | ease-in | ease-out | ease-in-out

§

CubicBezier

cubic-bezier(<number>, <number>, <number>, <number>)

Fields

§x1: f32
§y1: f32
§x2: f32
§y2: f32
§

Steps(i32, StepPosition)

step-start | step-end | steps(<integer>, [ <step-position> ]?) <step-position> = jump-start | jump-end | jump-none | jump-both | start | end

§

LinearFunction(PiecewiseLinearFunction)

linear([]#) = && ? = {1, 2}

Implementations§

source§

impl ComputedTimingFunction

source

fn calculate_step_output( steps: i32, pos: StepPosition, progress: f64, before_flag: BeforeFlag, ) -> f64

source

pub fn calculate_output( &self, progress: f64, before_flag: BeforeFlag, epsilon: f64, ) -> f64

The output of the timing function given the progress ratio of this animation.