mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Fix the computation of the interpolation of FontWeight.
This commit is contained in:
parent
689dadc751
commit
f91bcfd92e
1 changed files with 1 additions and 1 deletions
|
@ -1421,7 +1421,7 @@ impl Animatable for FontWeight {
|
|||
let b = other.0 as f64;
|
||||
const NORMAL: f64 = 400.;
|
||||
let weight = (a - NORMAL) * self_portion + (b - NORMAL) * other_portion + NORMAL;
|
||||
let weight = (weight.min(100.).max(900.) / 100.).round() * 100.;
|
||||
let weight = (weight.max(100.).min(900.) / 100.).round() * 100.;
|
||||
Ok(FontWeight(weight as u16))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue