mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
implementing Fixed constraint
This commit is contained in:
parent
a57bb60ac9
commit
4b19abd98a
4 changed files with 66 additions and 10 deletions
|
|
@ -385,6 +385,26 @@ impl<T> Align<T> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Enforce fixed size of drawing area
|
||||
pub enum Fixed<U: Number, T> {
|
||||
/// Enforce fixed width
|
||||
W(U, T),
|
||||
/// Enforce fixed height
|
||||
H(U, T),
|
||||
/// Enforce fixed width and height
|
||||
WH(U, U, T),
|
||||
}
|
||||
|
||||
impl<N: Number, T> Fixed<N, T> {
|
||||
pub fn inner (&self) -> &T {
|
||||
match self {
|
||||
Self::W(_, inner) => inner,
|
||||
Self::H(_, inner) => inner,
|
||||
Self::WH(_, _, inner) => inner,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Enforce minimum size of drawing area
|
||||
pub enum Min<U: Number, T> {
|
||||
/// Enforce minimum width
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue