mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Rewrite interpolate() in terms of a more general add_weighted() function
Generalizing the procedure like this will allow us to re-use it for addition of most types.
This commit is contained in:
parent
8366b4d4f9
commit
2f07b29296
7 changed files with 261 additions and 200 deletions
|
@ -129,7 +129,8 @@ macro_rules! define_keyword_type {
|
|||
|
||||
impl Animatable for $name {
|
||||
#[inline]
|
||||
fn interpolate(&self, _other: &Self, _progress: f64) -> Result<Self, ()> {
|
||||
fn add_weighted(&self, _other: &Self, _self_progress: f64, _other_progress: f64)
|
||||
-> Result<Self, ()> {
|
||||
Ok($name)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue