Skip to content

Commit

Permalink
Fix the computation of the interpolation of FontWeight.
Browse files Browse the repository at this point in the history
  • Loading branch information
BorisChiou committed Aug 8, 2017
1 parent 689dadc commit f91bcfd
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -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))
}

Expand Down

0 comments on commit f91bcfd

Please sign in to comment.