From 980ac6c2a42541224d694f9cd0699f6236fb66ca Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 1 May 2020 04:30:54 +0200 Subject: Add `UNIT` constant to `Size` --- core/src/size.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/src') diff --git a/core/src/size.rs b/core/src/size.rs index 4276f05f..a02299e8 100644 --- a/core/src/size.rs +++ b/core/src/size.rs @@ -15,6 +15,11 @@ impl Size { /// [`Size`]: struct.Size.html pub const ZERO: Size = Size::new(0., 0.); + /// A [`Size`] with a width and height of 1 unit. + /// + /// [`Size`]: struct.Size.html + pub const UNIT: Size = Size::new(1., 1.); + /// A [`Size`] with infinite width and height. /// /// [`Size`]: struct.Size.html -- cgit