Refactor how calc() clamping is done on computed values (fixes #15296)

This commit is contained in:
Anthony Ramine 2017-05-16 15:44:59 +02:00
parent f935f2da01
commit d0b9bd9c64
13 changed files with 173 additions and 154 deletions

View file

@ -1035,11 +1035,9 @@ impl Animatable for CalcLengthOrPercentage {
}
}
Ok(CalcLengthOrPercentage {
length: try!(self.length.add_weighted(&other.length, self_portion, other_portion)),
percentage: try!(add_weighted_half(self.percentage, other.percentage,
self_portion, other_portion)),
})
let length = self.length().add_weighted(&other.length(), self_portion, other_portion)?;
let percentage = add_weighted_half(self.percentage, other.percentage, self_portion, other_portion)?;
Ok(CalcLengthOrPercentage::with_clamping_mode(length, percentage, self.clamping_mode))
}
#[inline]