pub struct EdgeInsetsDirectional {
pub start: f64,
pub top: f64,
pub end: f64,
pub bottom: f64,
}Expand description
An immutable set of offsets in each of the four cardinal directions, but whose horizontal components are dependent on the writing direction.
This can be used to indicate padding from the left in TextDirection::Ltr
text and padding from the right in TextDirection::Rtl text without
having to be aware of the current text direction.
See also:
EdgeInsets, a variant that uses physical labels (left and right instead of start and end).
Fields§
§start: f64The offset from the start side, the side from which the user will start reading text.
This value is normalized into an EdgeInsets::left or
EdgeInsets::right value by the resolve method.
top: f64The offset from the top.
This value is passed through to EdgeInsets::top unmodified by the
resolve method.
end: f64The offset from the end side, the side on which the user ends reading text.
This value is normalized into an EdgeInsets::left or
EdgeInsets::right value by the resolve method.
bottom: f64The offset from the bottom.
This value is passed through to EdgeInsets::bottom unmodified by the
resolve method.
Implementations§
Source§impl EdgeInsetsDirectional
impl EdgeInsetsDirectional
Sourcepub const ZERO: EdgeInsetsDirectional
pub const ZERO: EdgeInsetsDirectional
An EdgeInsetsDirectional with zero offsets in each direction.
Consider using EdgeInsets::ZERO instead, since that object has the
same effect, but will be cheaper to resolve.
Sourcepub const fn from_steb(
start: f64,
top: f64,
end: f64,
bottom: f64,
) -> EdgeInsetsDirectional
pub const fn from_steb( start: f64, top: f64, end: f64, bottom: f64, ) -> EdgeInsetsDirectional
Creates insets from offsets from the start, top, end, and bottom.
Sourcepub const fn only(
start: f64,
top: f64,
end: f64,
bottom: f64,
) -> EdgeInsetsDirectional
pub const fn only( start: f64, top: f64, end: f64, bottom: f64, ) -> EdgeInsetsDirectional
Creates insets with only the given values non-zero.
Sourcepub const fn symmetric(horizontal: f64, vertical: f64) -> EdgeInsetsDirectional
pub const fn symmetric(horizontal: f64, vertical: f64) -> EdgeInsetsDirectional
Creates insets with symmetric vertical and horizontal offsets.
This is equivalent to EdgeInsets::symmetric, since the inset is the
same with either TextDirection. This constructor is just a
convenience for type compatibility.
Sourcepub const fn all(value: f64) -> EdgeInsetsDirectional
pub const fn all(value: f64) -> EdgeInsetsDirectional
Creates insets where all the offsets are value.
Sourcepub const fn with_start(self, start: f64) -> EdgeInsetsDirectional
pub const fn with_start(self, start: f64) -> EdgeInsetsDirectional
The same insets with the start side start: one of Dart’s copyWith arguments, named, so
a chain of them reads as Dart’s named arguments do.
Sourcepub const fn with_top(self, top: f64) -> EdgeInsetsDirectional
pub const fn with_top(self, top: f64) -> EdgeInsetsDirectional
The same insets with the top side top: one of Dart’s copyWith arguments, named, so
a chain of them reads as Dart’s named arguments do.
Sourcepub const fn with_end(self, end: f64) -> EdgeInsetsDirectional
pub const fn with_end(self, end: f64) -> EdgeInsetsDirectional
The same insets with the end side end: one of Dart’s copyWith arguments, named, so
a chain of them reads as Dart’s named arguments do.
Sourcepub const fn with_bottom(self, bottom: f64) -> EdgeInsetsDirectional
pub const fn with_bottom(self, bottom: f64) -> EdgeInsetsDirectional
The same insets with the bottom side bottom: one of Dart’s copyWith arguments, named, so
a chain of them reads as Dart’s named arguments do.
Sourcepub const fn with_horizontal(self, horizontal: f64) -> EdgeInsetsDirectional
pub const fn with_horizontal(self, horizontal: f64) -> EdgeInsetsDirectional
The same insets with the start and end sides each horizontal, as Dart’s
EdgeInsetsDirectional.symmetric(horizontal:) sets them.
Sourcepub const fn with_vertical(self, vertical: f64) -> EdgeInsetsDirectional
pub const fn with_vertical(self, vertical: f64) -> EdgeInsetsDirectional
The same insets with the top and bottom sides each vertical, as Dart’s
EdgeInsetsDirectional.symmetric(vertical:) sets them.
Sourcepub fn is_non_negative(&self) -> bool
pub fn is_non_negative(&self) -> bool
Whether every dimension is non-negative.
Sourcepub fn flipped(&self) -> EdgeInsetsDirectional
pub fn flipped(&self) -> EdgeInsetsDirectional
An EdgeInsetsDirectional with top and
bottom as well as start and
end flipped.
Sourcepub fn truncating_div(&self, other: f64) -> EdgeInsetsDirectional
pub fn truncating_div(&self, other: f64) -> EdgeInsetsDirectional
Integer divides the EdgeInsetsDirectional object in each dimension
by the given factor.
Sourcepub fn lerp(
a: Option<EdgeInsetsDirectional>,
b: Option<EdgeInsetsDirectional>,
t: f64,
) -> Option<EdgeInsetsDirectional>
pub fn lerp( a: Option<EdgeInsetsDirectional>, b: Option<EdgeInsetsDirectional>, t: f64, ) -> Option<EdgeInsetsDirectional>
Linearly interpolate between two EdgeInsetsDirectional.
If either is null, this function interpolates from
EdgeInsetsDirectional::ZERO.
To interpolate between two EdgeInsetsGeometry objects of arbitrary
type (either EdgeInsets or EdgeInsetsDirectional), consider the
EdgeInsetsGeometry.lerp static method.
Sourcepub fn resolve(&self, direction: Option<TextDirection>) -> EdgeInsets
pub fn resolve(&self, direction: Option<TextDirection>) -> EdgeInsets
Convert this instance into an EdgeInsets, which uses literal
coordinates.
Trait Implementations§
Source§impl Add for EdgeInsetsDirectional
Returns the sum of two EdgeInsetsDirectional objects.
impl Add for EdgeInsetsDirectional
Returns the sum of two EdgeInsetsDirectional objects.
Source§type Output = EdgeInsetsDirectional
type Output = EdgeInsetsDirectional
+ operator.Source§fn add(self, other: EdgeInsetsDirectional) -> EdgeInsetsDirectional
fn add(self, other: EdgeInsetsDirectional) -> EdgeInsetsDirectional
+ operation. Read moreSource§impl Clone for EdgeInsetsDirectional
impl Clone for EdgeInsetsDirectional
Source§fn clone(&self) -> EdgeInsetsDirectional
fn clone(&self) -> EdgeInsetsDirectional
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for EdgeInsetsDirectional
Source§impl Debug for EdgeInsetsDirectional
impl Debug for EdgeInsetsDirectional
Source§impl Default for EdgeInsetsDirectional
impl Default for EdgeInsetsDirectional
Source§fn default() -> EdgeInsetsDirectional
fn default() -> EdgeInsetsDirectional
Source§impl Div<f64> for EdgeInsetsDirectional
Divides the EdgeInsetsDirectional object in each dimension by the given
factor.
impl Div<f64> for EdgeInsetsDirectional
Divides the EdgeInsetsDirectional object in each dimension by the given
factor.
Source§type Output = EdgeInsetsDirectional
type Output = EdgeInsetsDirectional
/ operator.Source§impl From<EdgeInsetsDirectional> for EdgeInsetsGeometry
impl From<EdgeInsetsDirectional> for EdgeInsetsGeometry
Source§fn from(insets: EdgeInsetsDirectional) -> EdgeInsetsGeometry
fn from(insets: EdgeInsetsDirectional) -> EdgeInsetsGeometry
Source§impl Mul<f64> for EdgeInsetsDirectional
Scales the EdgeInsetsDirectional object in each dimension by the given
factor.
impl Mul<f64> for EdgeInsetsDirectional
Scales the EdgeInsetsDirectional object in each dimension by the given
factor.
Source§type Output = EdgeInsetsDirectional
type Output = EdgeInsetsDirectional
* operator.Source§impl Neg for EdgeInsetsDirectional
Returns the EdgeInsetsDirectional object with each dimension negated.
impl Neg for EdgeInsetsDirectional
Returns the EdgeInsetsDirectional object with each dimension negated.
This is the same as multiplying the object by -1.0.
Source§type Output = EdgeInsetsDirectional
type Output = EdgeInsetsDirectional
- operator.Source§fn neg(self) -> EdgeInsetsDirectional
fn neg(self) -> EdgeInsetsDirectional
- operation. Read moreSource§impl PartialEq for EdgeInsetsDirectional
impl PartialEq for EdgeInsetsDirectional
Source§impl Rem<f64> for EdgeInsetsDirectional
Computes the remainder in each dimension by the given factor.
impl Rem<f64> for EdgeInsetsDirectional
Computes the remainder in each dimension by the given factor.
Source§type Output = EdgeInsetsDirectional
type Output = EdgeInsetsDirectional
% operator.impl StructuralPartialEq for EdgeInsetsDirectional
Source§impl Sub for EdgeInsetsDirectional
Returns the difference between two EdgeInsetsDirectional objects.
impl Sub for EdgeInsetsDirectional
Returns the difference between two EdgeInsetsDirectional objects.
Source§type Output = EdgeInsetsDirectional
type Output = EdgeInsetsDirectional
- operator.Source§fn sub(self, other: EdgeInsetsDirectional) -> EdgeInsetsDirectional
fn sub(self, other: EdgeInsetsDirectional) -> EdgeInsetsDirectional
- operation. Read more