# SplineEasing

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/animation/easings/struct-splineeasing/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct SplineEasing
```

Eases a value using a user-defined cubic bezier curve. Good for custom
easing functions that are not possible with the built-in ones.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/easings/spline_easing.rs#L7)

## Members

- [`new`](#function-new)
- [`with_points`](#function-with_points)
- [`with_key_spline`](#function-with_key_spline)
- [`x1`](#function-x1)
- [`set_x1`](#function-set_x1)
- [`y1`](#function-y1)
- [`set_y1`](#function-set_y1)
- [`x2`](#function-x2)
- [`set_x2`](#function-set_x2)
- [`y2`](#function-y2)
- [`set_y2`](#function-set_y2)

<a id="function-new"></a>

### new

```rust
fn new() -> Self
```

Creates an easing with the default control points `(0, 0)` and
`(1, 1)`, which is a linear easing.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/easings/spline_easing.rs#L14)

<a id="function-with_points"></a>

### with_points

```rust
fn with_points(x1: f64, y1: f64, x2: f64, y2: f64) -> Self
```

Creates an easing with the given control points. Panics when an X
coordinate is outside `[0, 1]`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/easings/spline_easing.rs#L20)

<a id="function-with_key_spline"></a>

### with_key_spline

```rust
fn with_key_spline(key_spline: Ref<KeySpline>) -> Self
```

Creates an easing that uses `key_spline`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/easings/spline_easing.rs#L30)

<a id="function-x1"></a>

### x1

```rust
fn x1(self: &Self) -> f64
```

X coordinate of the first control point.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/easings/spline_easing.rs#L35)

<a id="function-set_x1"></a>

### set_x1

```rust
fn set_x1(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/easings/spline_easing.rs#L39)

<a id="function-y1"></a>

### y1

```rust
fn y1(self: &Self) -> f64
```

Y coordinate of the first control point.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/easings/spline_easing.rs#L44)

<a id="function-set_y1"></a>

### set_y1

```rust
fn set_y1(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/easings/spline_easing.rs#L48)

<a id="function-x2"></a>

### x2

```rust
fn x2(self: &Self) -> f64
```

X coordinate of the second control point.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/easings/spline_easing.rs#L53)

<a id="function-set_x2"></a>

### set_x2

```rust
fn set_x2(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/easings/spline_easing.rs#L57)

<a id="function-y2"></a>

### y2

```rust
fn y2(self: &Self) -> f64
```

Y coordinate of the second control point.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/easings/spline_easing.rs#L62)

<a id="function-set_y2"></a>

### set_y2

```rust
fn set_y2(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/easings/spline_easing.rs#L66)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ErasedDestructor`
- `IntoEither`
- `From<SplineEasing>`
- `Default`
- [`IEasing`](/docs/0.5.0/api/ferroui-base/animation/easings/trait-ieasing/)
- `PartialEq`
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)
- [`ValueTypeRegistration`](/docs/0.5.0/api/ferroui-base/data/core/trait-valuetyperegistration/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
