pub enum RelativeSize {
    Height(f64),
    Width(f64),
    Smaller(f64),
}
Expand description

Describes a relative size, might be 1. portion of height 2. portion of width 3. portion of the minimal of height and weight

Variants

Height(f64)

Percentage height

Width(f64)

Percentage width

Smaller(f64)

Percentage of either height or width, which is smaller

Implementations

Set the lower bound of the relative size.

  • min_sz: The minimal size the relative size can be in pixels
  • returns: The relative size with the bound

Set the upper bound of the relative size

  • max_size: The maximum size in pixels for this relative size
  • returns The relative size with the upper bound

Trait Implementations

Convert the size into the number of pixels Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.