aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Moffitt <jack@metajack.im>2013-08-23 17:11:24 -0600
committerJack Moffitt <jack@metajack.im>2013-08-23 17:11:24 -0600
commita3d5ca35a00273f83a5793e71e2cf4fe6c1f8e64 (patch)
tree9c1443b6d09be34e00466c483bc6552be3f945e0
parentd70178da86985aa39dad0f688f78f3cc8513f586 (diff)
downloadservo-a3d5ca35a00273f83a5793e71e2cf4fe6c1f8e64.tar.gz
servo-a3d5ca35a00273f83a5793e71e2cf4fe6c1f8e64.zip
Round results for scale_by and to_px.
This fixes the acid1 size issues where boxes were 1px too narrow.
-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 {