aboutsummaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/gfx/geometry.rs4
1 files 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<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 {