pub struct ShapeMorphSequence { /* private fields */ }Expand description
A reusable multi-step sequence of ShapeMorph transitions.
Implementations§
Source§impl ShapeMorphSequence
impl ShapeMorphSequence
Sourcepub fn new(
shapes: impl IntoIterator<Item = impl Into<ShapePolygon>>,
looping: bool,
) -> Option<ShapeMorphSequence>
pub fn new( shapes: impl IntoIterator<Item = impl Into<ShapePolygon>>, looping: bool, ) -> Option<ShapeMorphSequence>
Builds a feature-matched morph sequence from at least two shapes.
When looping is true, adds a wrap transition from the last shape back to the first.
Sourcepub fn perimeter_aligned(
shapes: impl IntoIterator<Item = impl Into<ShapePolygon>>,
looping: bool,
) -> Option<ShapeMorphSequence>
pub fn perimeter_aligned( shapes: impl IntoIterator<Item = impl Into<ShapePolygon>>, looping: bool, ) -> Option<ShapeMorphSequence>
Builds a perimeter-aligned morph sequence from at least two shapes.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Always false because valid sequences contain at least two shapes.
Sourcepub fn step_count(&self) -> usize
pub fn step_count(&self) -> usize
Number of morph transitions (len() - 1 when open, len() when looping).
pub fn is_looping(&self) -> bool
Sourcepub fn rotation_scale(&self) -> f32
pub fn rotation_scale(&self) -> f32
Minimum rotation-safe scale factor across all shapes in the sequence.
Sourcepub fn sample(&self, bounds: Bounds<Pixels>, progress: f32) -> Option<Shape>
pub fn sample(&self, bounds: Bounds<Pixels>, progress: f32) -> Option<Shape>
Samples the open progression across [0, 1] from the first shape to the last.
Sourcepub fn sample_step(
&self,
step: usize,
progress: f32,
bounds: Bounds<Pixels>,
fit: ShapeFit,
rotation_radians: f32,
) -> Option<Shape>
pub fn sample_step( &self, step: usize, progress: f32, bounds: Bounds<Pixels>, fit: ShapeFit, rotation_radians: f32, ) -> Option<Shape>
Samples a specific transition step at progress in 0..=1.
Sourcepub fn sample_step_polygon(
&self,
step: usize,
progress: f32,
) -> Option<ShapePolygon>
pub fn sample_step_polygon( &self, step: usize, progress: f32, ) -> Option<ShapePolygon>
Samples a specific transition step as a reusable ShapePolygon.
Sourcepub fn sample_step_in_envelope(
&self,
step: usize,
progress: f32,
bounds: Bounds<Pixels>,
extent: Pixels,
rotation_radians: f32,
) -> Option<Shape>
pub fn sample_step_in_envelope( &self, step: usize, progress: f32, bounds: Bounds<Pixels>, extent: Pixels, rotation_radians: f32, ) -> Option<Shape>
Samples a transition step centered on its live cubic bounding box and scaled to
fit safely inside a circular envelope of diameter extent under arbitrary rotation.
Used by LoadingIndicator to keep rotating Material and custom morph sequences
strictly inside their active footprint without resizing shared endpoints.
Trait Implementations§
Source§impl Clone for ShapeMorphSequence
impl Clone for ShapeMorphSequence
Source§fn clone(&self) -> ShapeMorphSequence
fn clone(&self) -> ShapeMorphSequence
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Forget for ShapeMorphSequence
impl Freeze for ShapeMorphSequence
impl Move for ShapeMorphSequence
impl RefUnwindSafe for ShapeMorphSequence
impl Send for ShapeMorphSequence
impl Sync for ShapeMorphSequence
impl Unpin for ShapeMorphSequence
impl UnsafeUnpin for ShapeMorphSequence
impl UnwindSafe for ShapeMorphSequence
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more