# TransformTrackingHelper

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/input/text_input/struct-transformtrackinghelper/

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

```rust
struct TransformTrackingHelper
```

Tracks the transform of a visual to the root of its visual tree: tells
when it changes because the bounds of the visual or of one of its
ancestors changed, or because the visual was attached or detached.

The helper does not keep the tracked visual alive; the visual keeps the
helper alive for as long as it is tracked.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/text_input/transform_tracking_helper.rs#L15)

## Members

- [`new`](#function-new)
- [`set_visual`](#function-set_visual)
- [`matrix`](#function-matrix)
- [`matrix_changed`](#function-matrix_changed)
- [`dispose`](#function-dispose)
- [`track`](#function-track)
- [`observe`](#function-observe)

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

### new

```rust
fn new(defer_after_render_pass: bool) -> Rc<TransformTrackingHelper>
```

Creates the helper. With `defer_after_render_pass` a change of
bounds is processed after the next render pass, otherwise right
before it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/text_input/transform_tracking_helper.rs#L30)

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

### set_visual

```rust
fn set_visual(self: &Self, visual: Option<&Ref<Visual>>)
```

Sets the visual to track, or stops tracking.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/text_input/transform_tracking_helper.rs#L52)

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

### matrix

```rust
fn matrix(self: &Self) -> Option<Matrix>
```

The transform of the tracked visual to its visual root, if it is
attached to one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/text_input/transform_tracking_helper.rs#L76)

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

### matrix_changed

```rust
fn matrix_changed(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
```

Raised when `matrix` has changed. Dropping the
returned guard unsubscribes; `Subscription::detach` keeps the
handler for the life of the helper.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/text_input/transform_tracking_helper.rs#L83)

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

### dispose

```rust
fn dispose(self: &Self)
```

Stops tracking the visual.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/text_input/transform_tracking_helper.rs#L94)

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

### track

```rust
fn track(visual: &Ref<Visual>, defer_after_render_pass: bool, cb: impl Fn(&Ref<Visual>, Option<Matrix>) -> () + 'static) -> Subscription
```

Tracks the transform of a visual, calling `cb` with the visual and
its transform whenever it changes. Dropping the returned guard stops
tracking; `Subscription::detach` keeps tracking for the life of the
visual.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/text_input/transform_tracking_helper.rs#L174)

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

### observe

```rust
fn observe(visual: &Ref<Visual>, defer_after_render_pass: bool) -> Rc<dyn IObservable<Option<Matrix>>>
```

Returns an observable of the transform of a visual to its visual
root.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/text_input/transform_tracking_helper.rs#L196)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`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`
- [`IDisposable`](/docs/0.5.0/api/ferroui-base/reactive/use-idisposable/)

## Availability

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