pub enum LayoutSize {
Fraction(f32),
Px(f32),
}Expand description
A layout length that may not be a percent: a gap, radius, border width, font size, padding or margin side, or 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 in_bounds(self) -> bool
pub fn in_bounds(self) -> bool
Whether the number is finite and within its unit’s bound: MAX_LAYOUT_FRACTION or
MAX_LAYOUT_PX.
Sourcepub fn without_px(self, shorter_side: f32) -> Self
pub fn without_px(self, shorter_side: f32) -> Self
The same size with pixels converted to 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 AnimatedValue for LayoutSize
impl AnimatedValue for LayoutSize
Source§const ACCEPTS_DATA: bool = false
const ACCEPTS_DATA: bool = false
Whether the type takes the
data value mode.Source§const INTERPOLATES: bool = true
const INTERPOLATES: bool = true
Whether keyframes of the type can interpolate; those of the others only hold.
Source§const OFFSETS: bool = false
const OFFSETS: bool = false
Whether two values of the type have a difference to add: what
repeat_offset needs.Source§const VALUE_CURVES: bool = false
const VALUE_CURVES: bool = false
Whether a keyframe of the type can start a value curve (
ValueBezier).Source§const SPLIT: Option<(usize, usize)> = None
const SPLIT: Option<(usize, usize)> = None
The fewest and the most channels the type’s
split mode takes, or None for a type
without the mode.Source§fn takes_value_curve(&self) -> bool
fn takes_value_curve(&self) -> bool
Whether a keyframe holding this value may start or end a value curve.
Source§fn extrapolates(&self, extrapolation: Extrapolation) -> bool
fn extrapolates(&self, extrapolation: Extrapolation) -> bool
Whether keyframes holding this value may extrapolate by
extrapolation.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 Forget for LayoutSize
impl Freeze for LayoutSize
impl Move 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