mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Tweak CalcLengthOrPercentage to use pixel value.
We compute the distance for eCSSUnit_Calc by pixel value in Gecko, so let's follow the same rules.
This commit is contained in:
parent
5964be7721
commit
a5433ad68a
1 changed files with 2 additions and 1 deletions
|
@ -78,7 +78,8 @@ impl ComputeSquaredDistance for CalcLengthOrPercentage {
|
|||
// FIXME(nox): This looks incorrect to me, to add a distance between lengths
|
||||
// with a distance between percentages.
|
||||
Ok(
|
||||
self.unclamped_length().compute_squared_distance(&other.unclamped_length())? +
|
||||
self.unclamped_length().to_f64_px().compute_squared_distance(
|
||||
&other.unclamped_length().to_f64_px())? +
|
||||
self.percentage().compute_squared_distance(&other.percentage())?,
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue