aboutsummaryrefslogtreecommitdiffstats
path: root/components/util/geometry.rs
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2015-05-05 18:40:00 +0200
committerSimon Sapin <simon.sapin@exyr.org>2015-05-05 18:40:00 +0200
commitb1ecba9f3d30e2fe832f216f1453ada0750140c7 (patch)
treed8574ac9e0f11c3cda76baec7ad89e7fc2ca0c7d /components/util/geometry.rs
parent8b522f2e7d08aaf73429207cbbfd9da915f6d9a5 (diff)
downloadservo-b1ecba9f3d30e2fe832f216f1453ada0750140c7.tar.gz
servo-b1ecba9f3d30e2fe832f216f1453ada0750140c7.zip
Use i32 instead of isize in Au methods.
Diffstat (limited to 'components/util/geometry.rs')
-rw-r--r--components/util/geometry.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/components/util/geometry.rs b/components/util/geometry.rs
index 684b06183f8..8f40e92e397 100644
--- a/components/util/geometry.rs
+++ b/components/util/geometry.rs
@@ -201,7 +201,7 @@ impl Au {
}
#[inline]
- pub fn from_px(px: isize) -> Au {
+ pub fn from_px(px: i32) -> Au {
Au((px * 60) as i32)
}
@@ -212,29 +212,29 @@ impl Au {
/// Rounds this app unit down to the pixel towards zero and returns it.
#[inline]
- pub fn to_px(&self) -> isize {
+ pub fn to_px(&self) -> i32 {
let Au(a) = *self;
- (a / 60) as isize
+ (a / 60)
}
/// Rounds this app unit down to the previous (left or top) pixel and returns it.
#[inline]
- pub fn to_prev_px(&self) -> isize {
+ pub fn to_prev_px(&self) -> i32 {
let Au(s) = *self;
- ((s as f64) / 60f64).floor() as isize
+ ((s as f64) / 60f64).floor() as i32
}
/// Rounds this app unit up to the next (right or bottom) pixel and returns it.
#[inline]
- pub fn to_next_px(&self) -> isize {
+ pub fn to_next_px(&self) -> i32 {
let Au(s) = *self;
- ((s as f64) / 60f64).ceil() as isize
+ ((s as f64) / 60f64).ceil() as i32
}
#[inline]
- pub fn to_nearest_px(&self) -> isize {
+ pub fn to_nearest_px(&self) -> i32 {
let Au(s) = *self;
- ((s as f64) / 60f64).round() as isize
+ ((s as f64) / 60f64).round() as i32
}
#[inline]