From a3d5ca35a00273f83a5793e71e2cf4fe6c1f8e64 Mon Sep 17 00:00:00 2001 From: Jack Moffitt Date: Fri, 23 Aug 2013 17:11:24 -0600 Subject: [PATCH] Round results for scale_by and to_px. This fixes the acid1 size issues where boxes were 1px too narrow. --- src/components/gfx/geometry.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/gfx/geometry.rs b/src/components/gfx/geometry.rs index 0f3b53ae197..f619615f21d 100644 --- a/src/components/gfx/geometry.rs +++ b/src/components/gfx/geometry.rs @@ -82,7 +82,7 @@ pub fn box + Sub>(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 {