aboutsummaryrefslogtreecommitdiffstats
path: root/components/util/geometry.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2016-08-11 00:29:19 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2016-08-12 03:12:06 +0200
commit6259df5e2da6574f3d5951a7df2cb511d263697a (patch)
treef68cc95e507fc7e208a3c04de637c0914bcd9d60 /components/util/geometry.rs
parentb7facf41cbc7ba727666e95fd0c390d432d862fa (diff)
downloadservo-6259df5e2da6574f3d5951a7df2cb511d263697a.tar.gz
servo-6259df5e2da6574f3d5951a7df2cb511d263697a.zip
Update to euclid 0.8
Diffstat (limited to 'components/util/geometry.rs')
-rw-r--r--components/util/geometry.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/components/util/geometry.rs b/components/util/geometry.rs
index 95b6194a14e..84d3761b92c 100644
--- a/components/util/geometry.rs
+++ b/components/util/geometry.rs
@@ -32,16 +32,10 @@ known_heap_size!(0, ScreenPx);
// originally proposed in 2002 as a standard unit of measure in Gecko.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=177805 for more info.
-pub static MAX_RECT: Rect<Au> = Rect {
- origin: Point2D {
- x: Au(i32::MIN / 2),
- y: Au(i32::MIN / 2),
- },
- size: Size2D {
- width: MAX_AU,
- height: MAX_AU,
- }
-};
+#[inline(always)]
+pub fn max_rect() -> Rect<Au> {
+ Rect::new(Point2D::new(Au(i32::MIN / 2), Au(i32::MIN / 2)), Size2D::new(MAX_AU, MAX_AU))
+}
/// A helper function to convert a rect of `f32` pixels to a rect of app units.
pub fn f32_rect_to_au_rect(rect: Rect<f32>) -> Rect<Au> {