diff options
Diffstat (limited to 'src/tuice/layout/bounds.rs')
-rw-r--r-- | src/tuice/layout/bounds.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tuice/layout/bounds.rs b/src/tuice/layout/bounds.rs index 59fe3ff2..15cf7dcc 100644 --- a/src/tuice/layout/bounds.rs +++ b/src/tuice/layout/bounds.rs @@ -2,6 +2,7 @@ /// /// These are sent from a parent component to a child to determine the [`Size`](super::Size) /// of a child, which is passed back up to the parent. +#[derive(Clone, Copy, Default)] pub struct Bounds { /// The minimal width available. pub min_width: u16, @@ -15,3 +16,14 @@ pub struct Bounds { /// The maximal height available. pub max_height: u16, } + +impl Bounds { + pub fn with_two_bounds(width: u16, height: u16) -> Self { + Self { + min_width: width, + min_height: height, + max_width: width, + max_height: height, + } + } +} |