Don't fallback to discrete animation within add_weighted() for Either<>.

For CSS Transitions we want this case to return Err() so we know that the two
values are not interpolable.

For CSS Animations/Web Animations we implement discrete animation as the
fallback behavior when Err() is returned.
This commit is contained in:
Hiroyuki Ikezoe 2017-08-15 13:04:06 +09:00
parent fa3b62746d
commit bff67d8272

View file

@ -2410,10 +2410,7 @@ impl<T, U> Animatable for Either<T, U>
(Either::Second(ref this), Either::Second(ref other)) => {
this.add_weighted(&other, self_portion, other_portion).map(Either::Second)
},
_ => {
let result = if self_portion > other_portion {*self} else {*other};
Ok(result)
}
_ => Err(()),
}
}
}