Struct style::bezier::Bezier
[−]
[src]
pub struct Bezier { /* fields omitted */ }
A unit cubic Bézier curve, used for timing functions in CSS transitions and animations.
Methods
impl Bezier
[src]
pub fn new(x1: CSSFloat, y1: CSSFloat, x2: CSSFloat, y2: CSSFloat) -> Bezier
[src]
Create a unit cubic Bézier curve from the two middle control points.
X coordinate is time, Y coordinate is function advancement. The nominal range for both is 0 to 1.
The start and end points are always (0, 0) and (1, 1) so that a transition or animation starts at 0% and ends at 100%.
pub fn solve(&self, x: f64, epsilon: f64) -> f64
[src]
Solve the bezier curve for a given x
and an epsilon
, that should be
between zero and one.