mirror of
https://github.com/servo/servo.git
synced 2025-08-12 17:05:33 +01:00
Refactor how calc() clamping is done on computed values (fixes #15296)
This commit is contained in:
parent
f935f2da01
commit
d0b9bd9c64
13 changed files with 173 additions and 154 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue