pub struct RippleRegistry { /* private fields */ }Expand description
Registro de ripples vivos, retenido por el runtime entre frames. Una
instancia por ventana; el runtime llama Self::trigger en el press y
Self::paint tras el paint del contenido.
Implementations§
Source§impl RippleRegistry
impl RippleRegistry
pub fn new() -> RippleRegistry
Sourcepub fn trigger(
&mut self,
key: u64,
lx: f32,
ly: f32,
color: AlphaColor<Srgb>,
duration: Duration,
now: Instant,
)
pub fn trigger( &mut self, key: u64, lx: f32, ly: f32, color: AlphaColor<Srgb>, duration: Duration, now: Instant, )
Registra una salpicadura nueva sobre el nodo de key key, originada en
(lx, ly) relativo a su rect. now es el instante del press. Varios
presses rápidos apilan ondas concurrentes (como Material).
Sourcepub fn animating(&self) -> bool
pub fn animating(&self) -> bool
true si hay alguna salpicadura viva (el runtime ya lo sabe por el
retorno de Self::paint, pero es cómodo para decidir antes).
Sourcepub fn paint<Msg>(
&mut self,
scene: &mut Scene,
mounted: &Mounted<Msg>,
computed: &ComputedLayout,
now: Instant,
) -> bool
pub fn paint<Msg>( &mut self, scene: &mut Scene, mounted: &Mounted<Msg>, computed: &ComputedLayout, now: Instant, ) -> bool
Pinta las salpicaduras vivas sobre scene, cada una como un círculo que
crece (radio con ease-out hasta cubrir el nodo) y se desvanece, recortado
al contorno redondeado del nodo. Resuelve el rect de cada nodo por su
ripple.key en mounted/computed (así sigue al nodo si se redimensiona).
Descarta las agotadas. Devuelve true si queda alguna viva → pedir frame.
Llamar DESPUÉS del paint del contenido (la onda va encima, translúcida).
Trait Implementations§
Source§impl Default for RippleRegistry
impl Default for RippleRegistry
Source§fn default() -> RippleRegistry
fn default() -> RippleRegistry
Auto Trait Implementations§
impl Freeze for RippleRegistry
impl RefUnwindSafe for RippleRegistry
impl Send for RippleRegistry
impl Sync for RippleRegistry
impl Unpin for RippleRegistry
impl UnsafeUnpin for RippleRegistry
impl UnwindSafe for RippleRegistry
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.