Make vertical-align animatable between percentage and percentage or length.

This commit is contained in:
Hiroyuki Ikezoe 2017-08-15 09:58:29 +09:00
parent 5c9ba6e631
commit 03c5462cf5

View file

@ -943,10 +943,10 @@ impl Animatable for VerticalAlign {
#[inline] #[inline]
fn add_weighted(&self, other: &Self, self_portion: f64, other_portion: f64) -> Result<Self, ()> { fn add_weighted(&self, other: &Self, self_portion: f64, other_portion: f64) -> Result<Self, ()> {
match (*self, *other) { match (*self, *other) {
(VerticalAlign::LengthOrPercentage(LengthOrPercentage::Length(ref this)), (VerticalAlign::LengthOrPercentage(ref this),
VerticalAlign::LengthOrPercentage(LengthOrPercentage::Length(ref other))) => { VerticalAlign::LengthOrPercentage(ref other)) => {
this.add_weighted(other, self_portion, other_portion).map(|value| { this.add_weighted(other, self_portion, other_portion).map(|value| {
VerticalAlign::LengthOrPercentage(LengthOrPercentage::Length(value)) VerticalAlign::LengthOrPercentage(value)
}) })
} }
_ => Err(()), _ => Err(()),