pub enum LayoutSize {
Fraction(f32),
Px(f32),
}Expand description
A layout length that may not be a percent: a gap, a radius, a border width, a font size, a padding or margin side, a translation.
Variants§
Fraction(f32)
A fraction of the layout picture’s shorter side, written as a number.
Px(f32)
Pixels of the project canvas, written "<n>px".
Implementations§
Source§impl LayoutSize
impl LayoutSize
Sourcepub fn without_px(self, shorter_side: f32) -> Self
pub fn without_px(self, shorter_side: f32) -> Self
The same size with pixels turned into a fraction of a picture
shorter_side pixels on its shorter side.
Sourcepub fn fraction(self, shorter_side: f32) -> f32
pub fn fraction(self, shorter_side: f32) -> f32
Its fraction of a picture shorter_side pixels on its shorter side.
Sourcepub const fn with_value(self, value: f32) -> Self
pub const fn with_value(self, value: f32) -> Self
The same kind of size with value.
Trait Implementations§
Source§impl Clone for LayoutSize
impl Clone for LayoutSize
impl Copy for LayoutSize
Source§impl Debug for LayoutSize
impl Debug for LayoutSize
Source§impl Default for LayoutSize
impl Default for LayoutSize
Source§impl<'de> Deserialize<'de> for LayoutSize
impl<'de> Deserialize<'de> for LayoutSize
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for LayoutSize
impl Display for LayoutSize
Source§impl PartialEq for LayoutSize
impl PartialEq for LayoutSize
Source§impl Serialize for LayoutSize
impl Serialize for LayoutSize
impl StructuralPartialEq for LayoutSize
Auto Trait Implementations§
impl Freeze for LayoutSize
impl RefUnwindSafe for LayoutSize
impl Send for LayoutSize
impl Sync for LayoutSize
impl Unpin for LayoutSize
impl UnsafeUnpin for LayoutSize
impl UnwindSafe for LayoutSize
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more