FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    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.

    Source

    set_visual

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

    Sets the visual to track, or stops tracking.

    Source

    matrix

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

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

    Source

    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.

    Source

    dispose

    fn dispose(self: &Self)
    

    Stops tracking the visual.

    Source

    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.

    Source

    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.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ErasedDestructor
    • IntoEither
    • IDisposable

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.