pub enum AlignmentGeometry {
Physical(Alignment),
Directional(AlignmentDirectional),
}Expand description
A resolvable anchor — either physical (Alignment) or directional
(AlignmentDirectional). A widget accepts either one, through Into, and
resolves it against the reading direction at render time.
Variants§
Physical(Alignment)
A physical anchor, with absolute left and right.
Directional(AlignmentDirectional)
A directional anchor (start/end, mirrored in RTL).
Implementations§
Source§impl AlignmentGeometry
impl AlignmentGeometry
Sourcepub fn resolve(self, direction: TextDirection) -> Alignment
pub fn resolve(self, direction: TextDirection) -> Alignment
Resolves to a physical anchor for a reading direction; an already physical anchor is returned unchanged.
Source§impl AlignmentGeometry
impl AlignmentGeometry
Sourcepub fn fractions(self) -> (f32, f32)
pub fn fractions(self) -> (f32, f32)
This anchor’s two fractions, in its own coordinates: x for a physical
anchor, start-to-end for a directional one.
Sourcepub fn with_fractions(self, x: f32, y: f32) -> AlignmentGeometry
pub fn with_fractions(self, x: f32, y: f32) -> AlignmentGeometry
The same kind of anchor with different fractions.
This is what an animation between two anchors interpolates. It stays in the anchor’s own coordinates, so the reading direction is applied to the result rather than to the endpoints — a directional anchor sliding from start to end mirrors as a whole in a right-to-left script, instead of interpolating between two physical points that were already mirrored and crossing in the middle.
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 more