aboutsummaryrefslogtreecommitdiffstats
path: root/components/util/geometry.rs
diff options
context:
space:
mode:
authorJack Moffitt <jack@metajack.im>2014-11-05 12:33:11 -0700
committerGlenn Watson <gw@intuitionlibrary.com>2014-11-13 11:17:43 +1000
commitd1b433a3b3bab353f320b2f39fa953ce326d2d55 (patch)
treed7a197abb65827b36c47e6b5c3adcce9071643d3 /components/util/geometry.rs
parent26045d7fcbab8851fbefe2851cd904203f8fd8dd (diff)
downloadservo-d1b433a3b3bab353f320b2f39fa953ce326d2d55.tar.gz
servo-d1b433a3b3bab353f320b2f39fa953ce326d2d55.zip
Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a
Diffstat (limited to 'components/util/geometry.rs')
-rw-r--r--components/util/geometry.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/components/util/geometry.rs b/components/util/geometry.rs
index 64d779d1f67..8dd6d633da7 100644
--- a/components/util/geometry.rs
+++ b/components/util/geometry.rs
@@ -28,6 +28,7 @@ use std::fmt;
///
/// The ratio between ScreenPx and DevicePixel for a given display be found by calling
/// `servo::windowing::WindowMethods::hidpi_factor`.
+#[deriving(Show)]
pub enum ScreenPx {}
/// One CSS "px" in the coordinate system of the "initial viewport":
@@ -39,7 +40,7 @@ pub enum ScreenPx {}
///
/// At the default zoom level of 100%, one PagePx is equal to one ScreenPx. However, if the
/// document is zoomed in or out then this scale may be larger or smaller.
-#[deriving(Encodable)]
+#[deriving(Encodable, Show)]
pub enum ViewportPx {}
/// One CSS "px" in the root coordinate system for the content document.
@@ -48,7 +49,7 @@ pub enum ViewportPx {}
/// This is the mobile-style "pinch zoom" that enlarges content without reflowing it. When the
/// viewport zoom is not equal to 1.0, then the layout viewport is no longer the same physical size
/// as the viewable area.
-#[deriving(Encodable)]
+#[deriving(Encodable, Show)]
pub enum PagePx {}
// In summary, the hierarchy of pixel units and the factors to convert from one to the next:
@@ -95,8 +96,8 @@ pub static MAX_RECT: Rect<Au> = Rect {
}
};
-pub static MIN_AU: Au = Au(i32::MIN);
-pub static MAX_AU: Au = Au(i32::MAX);
+pub const MIN_AU: Au = Au(i32::MIN);
+pub const MAX_AU: Au = Au(i32::MAX);
impl<E, S: Encoder<E>> Encodable<S, E> for Au {
fn encode(&self, e: &mut S) -> Result<(), E> {
@@ -319,4 +320,3 @@ pub fn f32_rect_to_au_rect(rect: Rect<f32>) -> Rect<Au> {
Rect(Point2D(Au::from_frac32_px(rect.origin.x), Au::from_frac32_px(rect.origin.y)),
Size2D(Au::from_frac32_px(rect.size.width), Au::from_frac32_px(rect.size.height)))
}
-