summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-05-01 04:30:54 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-05-01 04:30:54 +0200
commit980ac6c2a42541224d694f9cd0699f6236fb66ca (patch)
treeb296f5546c7ea6654a01d26b25b6dc484406cf8e /core
parent377ead93d6d506e7fe1e49d4b8b54c0f1d4c5e14 (diff)
downloadiced-980ac6c2a42541224d694f9cd0699f6236fb66ca.tar.gz
iced-980ac6c2a42541224d694f9cd0699f6236fb66ca.tar.bz2
iced-980ac6c2a42541224d694f9cd0699f6236fb66ca.zip
Add `UNIT` constant to `Size`
Diffstat (limited to 'core')
-rw-r--r--core/src/size.rs5
1 files changed, 5 insertions, 0 deletions
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