mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Define accumulate method on Animatable trait
This commit is contained in:
parent
2782c3391c
commit
64b0d59d21
1 changed files with 9 additions and 0 deletions
|
@ -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(()) }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue