relative

Function relative 

Source
pub const fn relative(fraction: f32) -> DefiniteLength
Expand description

Constructs a DefiniteLength representing a relative fraction of a parent size.

This function creates a DefiniteLength that is a specified fraction of a parent’s dimension. The fraction should be a floating-point number between 0.0 and 1.0, where 1.0 represents 100% of the parent’s size.

§Arguments

  • fraction - The fraction of the parent’s size, between 0.0 and 1.0.

§Returns

A DefiniteLength representing the relative length as a fraction of the parent’s size.