diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index 2863b04294c..3e12db37389 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -863,7 +863,7 @@ impl Animatable for f64 { impl Animatable for i32 { #[inline] fn add_weighted(&self, other: &i32, self_portion: f64, other_portion: f64) -> Result { - Ok((*self as f64 * self_portion + *other as f64 * other_portion).round() as i32) + Ok((*self as f64 * self_portion + *other as f64 * other_portion + 0.5).floor() as i32) } }