mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Round results for scale_by and to_px.
This fixes the acid1 size issues where boxes were 1px too narrow.
This commit is contained in:
parent
d70178da86
commit
a3d5ca35a0
1 changed files with 2 additions and 2 deletions
|
@ -82,7 +82,7 @@ pub fn box<T:Clone + Ord + Add<T,T> + Sub<T,T>>(x: T, y: T, w: T, h: T) -> Rect<
|
|||
|
||||
impl Au {
|
||||
pub fn scale_by(self, factor: float) -> Au {
|
||||
Au(((*self as float) * factor) as i32)
|
||||
Au(((*self as float) * factor).round() as i32)
|
||||
}
|
||||
|
||||
pub fn from_px(px: int) -> Au {
|
||||
|
@ -90,7 +90,7 @@ impl Au {
|
|||
}
|
||||
|
||||
pub fn to_px(&self) -> int {
|
||||
(**self / 60) as int
|
||||
((**self as float) / 60f).round() as int
|
||||
}
|
||||
|
||||
pub fn to_snapped(&self) -> Au {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue