mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
Review fixups
This commit is contained in:
parent
a98c0fc037
commit
466df01e71
4 changed files with 99 additions and 94 deletions
|
@ -162,16 +162,9 @@ impl<T: RepeatableListInterpolate> Interpolate for Vec<T> {
|
|||
fn interpolate(&self, other: &Self, time: f64) -> Result<Self, ()> {
|
||||
use num_integer::lcm;
|
||||
let len = lcm(self.len(), other.len());
|
||||
let ret = self.iter().cycle().zip(other.iter().cycle())
|
||||
.take(len)
|
||||
.filter_map(|(ref me, ref you)| {
|
||||
me.interpolate(you, time).ok()
|
||||
}).collect::<Self>();
|
||||
if ret.len() == len {
|
||||
Ok(ret)
|
||||
} else {
|
||||
Err(())
|
||||
}
|
||||
self.iter().cycle().zip(other.iter().cycle()).take(len).map(|(me, you)| {
|
||||
me.interpolate(you, time)
|
||||
}).collect()
|
||||
}
|
||||
}
|
||||
/// https://drafts.csswg.org/css-transitions/#animtype-number
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue