Define accumulate method on Animatable trait

This commit is contained in:
Brian Birtles 2017-05-24 09:09:56 +09:00
parent 2782c3391c
commit 64b0d59d21

View file

@ -680,6 +680,15 @@ pub trait Animatable: Sized {
self.add_weighted(other, 1.0, 1.0)
}
/// [Accumulates][animation-accumulation] this value onto itself (|count| - 1) times then
/// accumulates |other| onto the result.
/// If |count| is zero, the result will be |other|.
///
/// [animation-accumulation]: https://w3c.github.io/web-animations/#animation-accumulation
fn accumulate(&self, other: &Self, count: u64) -> Result<Self, ()> {
self.add_weighted(other, count as f64, 1.0)
}
/// Compute distance between a value and another for a given property.
fn compute_distance(&self, _other: &Self) -> Result<f64, ()> { Err(()) }