pub struct LinearBorderEdge {
pub size: f64,
pub alignment: f64,
}Expand description
Defines the relative size and alignment of one LinearBorder edge.
A LinearBorder defines a box outline as zero to four edges, each of
which is rendered as a single line. The width and color of the lines is
defined by LinearBorder::side.
Each line’s length is defined by size, a value between 0.0
and 1.0 (the default) which defines the length as a percentage of the
length of a box edge.
When size is less than 1.0, the line is aligned within the
available space according to alignment, a value
between -1.0 and 1.0. The default is 0.0, which means centered, -1.0 means
align on the “start” side, and 1.0 means align on the “end” side.
Fields§
§size: f64A value between 0.0 and 1.0 that defines the length of the edge as a percentage of the length of the corresponding box edge. Default is 1.0.
alignment: f64A value between -1.0 and 1.0 that defines how edges for which
size is less than 1.0 are aligned relative to the
corresponding box edge.
Implementations§
Source§impl LinearBorderEdge
impl LinearBorderEdge
Sourcepub fn new(size: f64, alignment: f64) -> LinearBorderEdge
pub fn new(size: f64, alignment: f64) -> LinearBorderEdge
Defines one side of a LinearBorder.
The values of size and alignment
must be between 0.0 and 1.0, and -1.0 and 1.0 respectively.
Sourcepub fn lerp(
a: Option<LinearBorderEdge>,
b: Option<LinearBorderEdge>,
t: f64,
) -> Option<LinearBorderEdge>
pub fn lerp( a: Option<LinearBorderEdge>, b: Option<LinearBorderEdge>, t: f64, ) -> Option<LinearBorderEdge>
Linearly interpolates between two LinearBorderEdges.
If both a and b are None then None is returned. If a is None then
we interpolate to b varying size from 0.0 to b.size.
If b is None then we interpolate from a varying size from a.size
to zero. Otherwise both values are interpolated.
Trait Implementations§
Source§impl Clone for LinearBorderEdge
impl Clone for LinearBorderEdge
Source§fn clone(&self) -> LinearBorderEdge
fn clone(&self) -> LinearBorderEdge
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more