pub struct Ripples { /* private fields */ }Expand description
Every splash currently alive on one widget.
There can be several: a second tap does not cancel the first one’s fade, it starts its own circle beside it — which is what makes drumming on a surface look like water rather than a switch.
Implementations§
Source§impl Ripples
impl Ripples
Sourcepub fn press(&mut self, origin: Point, size: Size)
pub fn press(&mut self, origin: Point, size: Size)
A finger landed at origin, in the coordinates of a box of size.
Sourcepub fn confirm(&mut self)
pub fn confirm(&mut self)
The tap completed. Only the splash still waiting for it is confirmed.
Sourcepub fn advance(&mut self, dt: f32) -> bool
pub fn advance(&mut self, dt: f32) -> bool
Advances every splash, dropping the ones that have gone. Returns true while
any is still moving.
Sourcepub fn hash_state<H: Hasher>(&self, h: &mut H)
pub fn hash_state<H: Hasher>(&self, h: &mut H)
Folds the splashes’ motion into a hash — what the paint-boundary cache compares to notice that a cached surface no longer paints what it did last frame.
Sourcepub fn paint(
&self,
owner: u64,
bounds: Rect,
radius: BorderRadius,
color: Color,
scene: &mut Scene,
)
pub fn paint( &self, owner: u64, bounds: Rect, radius: BorderRadius, color: Color, scene: &mut Scene, )
Paints the splashes into bounds, clipped to the box and its rounding.
The circles go into a composited layer whose shape erases whatever runs past
the corners — the same machinery crate::ClipRRect uses, and the reason ink
hugs a rounded button instead of squaring it off.