pub struct AnimRegistry { /* private fields */ }Expand description
Registro de animaciones implícitas, vivo entre frames. El runtime mantiene
una instancia y llama Self::reconcile en cada redraw.
Implementations§
Source§impl AnimRegistry
impl AnimRegistry
pub fn new() -> AnimRegistry
Sourcepub fn reconcile<Msg>(
&mut self,
mounted: &mut Mounted<Msg>,
now: Instant,
) -> bool
pub fn reconcile<Msg>( &mut self, mounted: &mut Mounted<Msg>, now: Instant, ) -> bool
Reconcilia el árbol montado con el estado retenido. Para cada nodo con
Anim: detecta si el objetivo cambió (arranca tween), interpola y
escribe el valor del frame de vuelta en el nodo (fill/radius). Las
keys que no aparecieron este frame se descartan (un nodo que se va deja
de animar). Devuelve true si alguna animación sigue en curso.
Llamar DESPUÉS de compute y ANTES de paint. now es el instante del
frame (el runtime pasa Instant::now(); los tests pasan instantes
controlados).
Sourcepub fn live_exit_nodes<Msg>(
&self,
mounted: &Mounted<Msg>,
) -> Vec<(usize, usize, u64)>
pub fn live_exit_nodes<Msg>( &self, mounted: &Mounted<Msg>, ) -> Vec<(usize, usize, u64)>
Nodos exit presentes este frame que el runtime debe capturar: por
cada uno devuelve (idx, subtree_end, key) para pintar su subárbol en
una subescena con crate::paint_range y entregarla a
Self::store_live_exit. Llamar DESPUÉS de paint (cuando el árbol y
la geometría ya están firmes).
Sourcepub fn store_live_exit(
&mut self,
key: u64,
scene: Scene,
duration: Duration,
easing: fn(f32) -> f32,
)
pub fn store_live_exit( &mut self, key: u64, scene: Scene, duration: Duration, easing: fn(f32) -> f32, )
Guarda (o refresca) la subescena retenida de un nodo exit presente. El
runtime la captura con crate::paint_range tras el paint. duration y
easing se heredan al fantasma cuando la key desaparezca.
Sourcepub fn replay_ghosts(
&mut self,
scene: &mut Scene,
now: Instant,
w: f32,
h: f32,
) -> bool
pub fn replay_ghosts( &mut self, scene: &mut Scene, now: Instant, w: f32, h: f32, ) -> bool
Reproduce los fantasmas activos sobre scene, cada uno con su opacidad
decreciente, clipeados al viewport (w, h). Llamar DESPUÉS del paint
principal (van por encima). Devuelve true si queda algún fantasma vivo
(el runtime ya lo sabe por Self::reconcile, pero es cómodo).
Trait Implementations§
Source§impl Default for AnimRegistry
impl Default for AnimRegistry
Source§fn default() -> AnimRegistry
fn default() -> AnimRegistry
Auto Trait Implementations§
impl !RefUnwindSafe for AnimRegistry
impl !UnwindSafe for AnimRegistry
impl Freeze for AnimRegistry
impl Send for AnimRegistry
impl Sync for AnimRegistry
impl Unpin for AnimRegistry
impl UnsafeUnpin for AnimRegistry
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.