pub struct TextAnchor { /* private fields */ }Expand description
A point of the complete measured block, independent of its line alignment.
Implementations§
Source§impl TextAnchor
impl TextAnchor
Sourcepub fn fractions(horizontal: f64, vertical: f64) -> Result<Self>
pub fn fractions(horizontal: f64, vertical: f64) -> Result<Self>
Arbitrary finite justification in a top-down block frame; no 0..1 clamp.
Sourcepub fn first_baseline(horizontal: f64) -> Result<Self>
pub fn first_baseline(horizontal: f64) -> Result<Self>
Attach to the actual first baseline at the chosen horizontal fraction.
Sourcepub fn center_baseline(horizontal: f64) -> Result<Self>
pub fn center_baseline(horizontal: f64) -> Result<Self>
Attach to the midpoint of the first and last measured baselines.
Sourcepub const fn get_horizontal(&self) -> f64
pub const fn get_horizontal(&self) -> f64
Authored horizontal fraction, without a 0..1 clamp.
Sourcepub const fn get_vertical_fraction(&self) -> Option<f64>
pub const fn get_vertical_fraction(&self) -> Option<f64>
Authored vertical fraction, absent for either baseline choice.
Sourcepub const fn is_first_baseline(&self) -> bool
pub const fn is_first_baseline(&self) -> bool
Whether the vertical choice is the first baseline rather than its center.
Source§impl TextAnchor
impl TextAnchor
Sourcepub const fn top_center() -> Self
pub const fn top_center() -> Self
Attach the block’s top_center point.
Sourcepub const fn center_left() -> Self
pub const fn center_left() -> Self
Attach the block’s center_left point.
Sourcepub const fn center_right() -> Self
pub const fn center_right() -> Self
Attach the block’s center_right point.
Sourcepub const fn bottom_left() -> Self
pub const fn bottom_left() -> Self
Attach the block’s bottom_left point.
Sourcepub const fn bottom_center() -> Self
pub const fn bottom_center() -> Self
Attach the block’s bottom_center point.
Sourcepub const fn bottom_right() -> Self
pub const fn bottom_right() -> Self
Attach the block’s bottom_right point.
Trait Implementations§
Source§impl Clone for TextAnchor
impl Clone for TextAnchor
impl Copy for TextAnchor
Source§impl Debug for TextAnchor
impl Debug for TextAnchor
impl Eq for TextAnchor
Source§impl PartialEq for TextAnchor
impl PartialEq for TextAnchor
impl StructuralPartialEq for TextAnchor
Auto Trait Implementations§
impl Forget for TextAnchor
impl Freeze for TextAnchor
impl Move for TextAnchor
impl RefUnwindSafe for TextAnchor
impl Send for TextAnchor
impl Sync for TextAnchor
impl Unpin for TextAnchor
impl UnsafeUnpin for TextAnchor
impl UnwindSafe for TextAnchor
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.