From 6d3e1d835e1688fbc58622a03a784ed25ed3f0e1 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 5 Apr 2024 23:59:21 +0200 Subject: Decouple caching from layering and simplify everything --- core/src/rectangle.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'core/src') diff --git a/core/src/rectangle.rs b/core/src/rectangle.rs index 45acd5ac..446d3769 100644 --- a/core/src/rectangle.rs +++ b/core/src/rectangle.rs @@ -33,9 +33,12 @@ where } impl Rectangle { + /// A rectangle starting at [`Point::ORIGIN`] with infinite width and height. + pub const INFINITE: Self = Self::new(Point::ORIGIN, Size::INFINITY); + /// Creates a new [`Rectangle`] with its top-left corner in the given /// [`Point`] and with the provided [`Size`]. - pub fn new(top_left: Point, size: Size) -> Self { + pub const fn new(top_left: Point, size: Size) -> Self { Self { x: top_left.x, y: top_left.y, -- cgit