Skip to main content

EasingCurveEditor

Struct EasingCurveEditor 

Source
pub struct EasingCurveEditor {
    pub current: Easing,
    pub compare: Option<Easing>,
    pub sample_count: usize,
}
Expand description

Interactive easing curve editor.

Fields§

§current: Easing

Current easing curve.

§compare: Option<Easing>

Optional comparison curve.

§sample_count: usize

Number of sample points used for rendering.

Implementations§

Source§

impl EasingCurveEditor

Source

pub fn new(easing: Easing) -> Self

Create an editor for an easing curve.

Source

pub fn set_easing(&mut self, easing: Easing)

Set the primary easing.

Source

pub fn set_compare(&mut self, easing: Option<Easing>)

Set an optional comparison easing.

Source

pub fn set_sample_count(&mut self, sample_count: usize)

Set curve sampling resolution. Values below two are clamped.

Source

pub fn samples(&self) -> Vec<[f32; 2]>

Return sample points for the current easing.

Source

pub fn samples_into(&self, out: &mut Vec<[f32; 2]>)

Write sample points for the current easing into a reusable buffer.

Source

pub fn compare_samples(&self) -> Option<Vec<[f32; 2]>>

Return sample points for the comparison easing.

Source

pub fn set_control_points(&mut self, x1: f32, y1: f32, x2: f32, y2: f32)

Update cubic-bezier control points and make them the current easing.

Source

pub fn copy_code(&self) -> String

Return Rust code for the current easing.

Trait Implementations§

Source§

impl Clone for EasingCurveEditor

Source§

fn clone(&self) -> EasingCurveEditor

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EasingCurveEditor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EasingCurveEditor

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for EasingCurveEditor

Source§

fn eq(&self, other: &EasingCurveEditor) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for EasingCurveEditor

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.