TiltAnimation
struct · ferroui-xaml-behaviors-animations · v0.5.0
struct TiltAnimation
Calculates and applies composition-based pointer tilt animations.
Members
calculate_orientation
fn calculate_orientation(size: Size, pointer_position: Point, tilt_strength: f64) -> Quaternion
Calculates a tilt orientation for a pointer position (relative to the target) inside a
target size; tilt_strength is the maximum tilt angle in degrees. Returns the calculated
orientation, or identity for an empty size or central position.
try_calculate_orientation
fn try_calculate_orientation(size: Size, pointer_position: Point, tilt_strength: f64) -> Option<Quaternion>
Tries to calculate a non-neutral tilt orientation for a pointer position inside a target
size. Returns the calculated orientation, or None for an empty size or central position.
Deviation (DEVIATIONS.md, Behaviors): the reference returns bool with the orientation in
an out parameter (the identity when it returns false); here the orientation is the
Some of the result.
apply
fn apply(target: Option<&Control>, pointer_position: Point, tilt_strength: f64) -> bool
Applies a tilt animation for a pointer position (relative to the target);
tilt_strength is the maximum tilt angle in degrees. Returns true when a composition
visual was animated; otherwise, false.
reset
fn reset(target: Option<&Control>) -> bool
Animates a control back to its neutral orientation. Returns true when a composition
visual was animated; otherwise, false.
update_center_point
fn update_center_point(target: Option<&Control>) -> bool
Updates a control's composition center point from its current bounds. Returns true when
a composition visual was updated; otherwise, false.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyClassDefaultsErasedDestructorIntoEither
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.