#[non_exhaustive]pub enum AlignmentGeometry {
Alignment(Alignment),
Directional(AlignmentDirectional),
Mixed {
x: f64,
start: f64,
y: f64,
},
}Expand description
Base class for Alignment that allows for text-direction aware
resolution.
A property or argument of this type accepts classes created either with
Alignment and its variants, or AlignmentDirectional::new.
To convert an AlignmentGeometry object of indeterminate type into an
Alignment object, call the resolve
method.
Non-exhaustive: Flutter may add a subclass.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Alignment(Alignment)
Visual alignment — Dart’s Alignment.
Directional(AlignmentDirectional)
Directional alignment — Dart’s AlignmentDirectional.
Mixed
A visual and a directional horizontal coordinate at once — Dart’s private
_MixedAlignment, what combining the two kinds produces.
Implementations§
Source§impl AlignmentGeometry
impl AlignmentGeometry
Sourcepub const TOP_LEFT: AlignmentGeometry
pub const TOP_LEFT: AlignmentGeometry
The top left corner.
Sourcepub const TOP_CENTER: AlignmentGeometry
pub const TOP_CENTER: AlignmentGeometry
The center point along the top edge.
Sourcepub const TOP_RIGHT: AlignmentGeometry
pub const TOP_RIGHT: AlignmentGeometry
The top right corner.
Sourcepub const TOP_START: AlignmentGeometry
pub const TOP_START: AlignmentGeometry
The top corner on the “start” edge.
Sourcepub const TOP_END: AlignmentGeometry
pub const TOP_END: AlignmentGeometry
The top corner on the “end” edge.
Sourcepub const CENTER_LEFT: AlignmentGeometry
pub const CENTER_LEFT: AlignmentGeometry
The center point along the left edge.
Sourcepub const CENTER: AlignmentGeometry
pub const CENTER: AlignmentGeometry
The center point, both horizontally and vertically.
Sourcepub const CENTER_RIGHT: AlignmentGeometry
pub const CENTER_RIGHT: AlignmentGeometry
The center point along the right edge.
Sourcepub const CENTER_START: AlignmentGeometry
pub const CENTER_START: AlignmentGeometry
The center point along the “start” edge.
Sourcepub const CENTER_END: AlignmentGeometry
pub const CENTER_END: AlignmentGeometry
The center point along the “end” edge.
Sourcepub const BOTTOM_LEFT: AlignmentGeometry
pub const BOTTOM_LEFT: AlignmentGeometry
The bottom left corner.
Sourcepub const BOTTOM_CENTER: AlignmentGeometry
pub const BOTTOM_CENTER: AlignmentGeometry
The center point along the bottom edge.
Sourcepub const BOTTOM_RIGHT: AlignmentGeometry
pub const BOTTOM_RIGHT: AlignmentGeometry
The bottom right corner.
Sourcepub const BOTTOM_START: AlignmentGeometry
pub const BOTTOM_START: AlignmentGeometry
The bottom corner on the “start” edge.
Sourcepub const BOTTOM_END: AlignmentGeometry
pub const BOTTOM_END: AlignmentGeometry
The bottom corner on the “end” edge.
Sourcepub const fn directional(start: f64, y: f64) -> AlignmentGeometry
pub const fn directional(start: f64, y: f64) -> AlignmentGeometry
Creates a directional alignment, or AlignmentDirectional.
Sourcepub fn add(self, other: AlignmentGeometry) -> AlignmentGeometry
pub fn add(self, other: AlignmentGeometry) -> AlignmentGeometry
Returns the sum of two AlignmentGeometry objects.
If you know you are adding two Alignment or two
AlignmentDirectional objects, consider using the + operator
instead, which always returns an object of the same type as the operands,
and is typed accordingly.
Applied to two objects of the same kind, the result is of that kind;
otherwise it is the mixed arm, which resolve turns
into a concrete Alignment.
Sourcepub fn truncating_div(&self, other: f64) -> AlignmentGeometry
pub fn truncating_div(&self, other: f64) -> AlignmentGeometry
Integer divides the AlignmentGeometry object in each dimension by
the given factor.
Sourcepub fn lerp(
a: Option<AlignmentGeometry>,
b: Option<AlignmentGeometry>,
t: f64,
) -> Option<AlignmentGeometry>
pub fn lerp( a: Option<AlignmentGeometry>, b: Option<AlignmentGeometry>, t: f64, ) -> Option<AlignmentGeometry>
Linearly interpolate between two AlignmentGeometry objects.
If either is None, this function interpolates from
Alignment::CENTER, and the result is of the same kind as the
non-None argument.
Applied to two objects of the same kind, the result is of that kind;
otherwise it is the mixed arm, which resolve turns
into a concrete Alignment.
Sourcepub fn resolve(&self, direction: Option<TextDirection>) -> Alignment
pub fn resolve(&self, direction: Option<TextDirection>) -> Alignment
Convert this instance into an Alignment, which uses literal
coordinates (the x coordinate being explicitly a distance from the
left).
See also:
Alignment, for which this is a no-op (returns itself).AlignmentDirectional, which flips the horizontal direction based on thedirectionargument.
Trait Implementations§
Source§impl Clone for AlignmentGeometry
impl Clone for AlignmentGeometry
Source§fn clone(&self) -> AlignmentGeometry
fn clone(&self) -> AlignmentGeometry
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 AlignmentGeometry
Source§impl Debug for AlignmentGeometry
impl Debug for AlignmentGeometry
Source§impl Display for AlignmentGeometry
Dart’s AlignmentGeometry.toString, which Debug already renders.
impl Display for AlignmentGeometry
Dart’s AlignmentGeometry.toString, which Debug already renders.
Source§impl Div<f64> for AlignmentGeometry
impl Div<f64> for AlignmentGeometry
Source§type Output = AlignmentGeometry
type Output = AlignmentGeometry
/ operator.Source§impl From<Alignment> for AlignmentGeometry
impl From<Alignment> for AlignmentGeometry
Source§fn from(alignment: Alignment) -> AlignmentGeometry
fn from(alignment: Alignment) -> AlignmentGeometry
Source§impl From<AlignmentDirectional> for AlignmentGeometry
impl From<AlignmentDirectional> for AlignmentGeometry
Source§fn from(alignment: AlignmentDirectional) -> AlignmentGeometry
fn from(alignment: AlignmentDirectional) -> AlignmentGeometry
Source§impl Mul<f64> for AlignmentGeometry
impl Mul<f64> for AlignmentGeometry
Source§type Output = AlignmentGeometry
type Output = AlignmentGeometry
* operator.Source§impl Neg for AlignmentGeometry
impl Neg for AlignmentGeometry
Source§type Output = AlignmentGeometry
type Output = AlignmentGeometry
- operator.Source§fn neg(self) -> AlignmentGeometry
fn neg(self) -> AlignmentGeometry
- operation. Read moreSource§impl PartialEq for AlignmentGeometry
impl PartialEq for AlignmentGeometry
Source§impl Rem<f64> for AlignmentGeometry
impl Rem<f64> for AlignmentGeometry
Source§type Output = AlignmentGeometry
type Output = AlignmentGeometry
% operator.