# KeySplineSolver

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

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

```rust
struct KeySplineSolver
```

The curve of a [`KeySpline`](/docs/0.5.0/api/ferroui-base/animation/struct-keyspline/) with fixed control points, as a plain value.

A key spline is an object of the UI thread; a spline easing that a key
frame animation of the compositor uses is evaluated on the render thread
with this solver. It is the same algorithm, with the same search state
(the parameter of the most recent progress is the next first guess).

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

## Members

- [`new`](#function-new)
- [`get_spline_progress`](#function-get_spline_progress)

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

### new

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

Creates the solver of the curve with the given control points.

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

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

### get_spline_progress

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

Calculates the spline progress from a linear progress.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Copy`
- `Debug`

## Availability

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