diff options
Diffstat (limited to 'components/util/geometry.rs')
-rw-r--r-- | components/util/geometry.rs | 14 |
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> { |