Skip to content

Commit

Permalink
Auto merge of servo#36 - servo:fix-trunc, r=jdm
Browse files Browse the repository at this point in the history
Fix scale_by_trunc

None
  • Loading branch information
bors-servo committed Sep 7, 2017
2 parents ed96df5 + 9d286f6 commit 8e3ccb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app_unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ impl Au {
}

#[inline]
/// Scale, but round down (useful for viewport-relative units)
/// Scale, but truncate (useful for viewport-relative units)
pub fn scale_by_trunc(self, factor: f32) -> Au {
let new_float = ((self.0 as f64) * factor as f64).floor();
let new_float = ((self.0 as f64) * factor as f64).trunc();
Au::from_f64_au(new_float)
}

Expand Down

0 comments on commit 8e3ccb5

Please sign in to comment.