TransformTrackingHelper
struct · ferroui-base · v0.5.0
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.
Members
new
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.
set_visual
fn set_visual(self: &Self, visual: Option<&Ref<Visual>>)
Sets the visual to track, or stops tracking.
matrix
fn matrix(self: &Self) -> Option<Matrix>
The transform of the tracked visual to its visual root, if it is attached to one.
matrix_changed
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.
dispose
fn dispose(self: &Self)
Stops tracking the visual.
track
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.
observe
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherIDisposable
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.