Create ferris example to showcase ContentFit and Rotation
This commit is contained in:
parent
610394b695
commit
efc55b655b
5 changed files with 234 additions and 1 deletions
|
|
@ -1,6 +1,8 @@
|
|||
//! Control the fit of some content (like an image) within a space.
|
||||
use crate::Size;
|
||||
|
||||
use std::fmt;
|
||||
|
||||
/// The strategy used to fit the contents of a widget to its bounding box.
|
||||
///
|
||||
/// Each variant of this enum is a strategy that can be applied for resolving
|
||||
|
|
@ -118,3 +120,15 @@ impl ContentFit {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for ContentFit {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.write_str(match self {
|
||||
ContentFit::Contain => "Contain",
|
||||
ContentFit::Cover => "Cover",
|
||||
ContentFit::Fill => "Fill",
|
||||
ContentFit::None => "None",
|
||||
ContentFit::ScaleDown => "Scale Down",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue