From f91bcfd92e0a48603268aff40ab30f4814140c45 Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Tue, 8 Aug 2017 13:34:53 +0800 Subject: [PATCH] Fix the computation of the interpolation of FontWeight. --- components/style/properties/helpers/animated_properties.mako.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index 19ca7e49e7a..222027044c3 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -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)) }