mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Round halfway values toward positive infinity for integer type of animation.
From the spec[1]; `with values halfway between a pair of integers rounded towards positive infinity.` [1] https://drafts.csswg.org/css-transitions/#animtype-integer
This commit is contained in:
parent
bff67d8272
commit
08ebc524cf
1 changed files with 1 additions and 1 deletions
|
@ -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<Self, ()> {
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue