pub enum Axis {
Horizontal,
Vertical,
}
Expand description
An axis in visual space.
Most often used by widgets to describe the direction in which they grow as their number of children increases. Has some methods for manipulating geometry with respect to the axis.
Variants§
Implementations§
source§impl Axis
impl Axis
sourcepub fn minor(self, size: Size) -> f64
pub fn minor(self, size: Size) -> f64
Extract from the argument the magnitude along the perpendicular axis
sourcepub fn major_span(self, rect: Rect) -> (f64, f64)
pub fn major_span(self, rect: Rect) -> (f64, f64)
Extract the extent of the argument in this axis as a pair.
sourcepub fn minor_span(self, rect: Rect) -> (f64, f64)
pub fn minor_span(self, rect: Rect) -> (f64, f64)
Extract the extent of the argument in the minor axis as a pair.
sourcepub fn major_pos(self, pos: Point) -> f64
pub fn major_pos(self, pos: Point) -> f64
Extract the coordinate locating the argument with respect to this axis.
sourcepub fn major_vec(self, vec: Vec2) -> f64
pub fn major_vec(self, vec: Vec2) -> f64
Extract the coordinate locating the argument with respect to this axis.
sourcepub fn minor_pos(self, pos: Point) -> f64
pub fn minor_pos(self, pos: Point) -> f64
Extract the coordinate locating the argument with respect to the perpendicular axis.
Trait Implementations§
source§impl PartialEq for Axis
impl PartialEq for Axis
impl Copy for Axis
impl StructuralPartialEq for Axis
Auto Trait Implementations§
impl Freeze for Axis
impl RefUnwindSafe for Axis
impl Send for Axis
impl Sync for Axis
impl Unpin for Axis
impl UnwindSafe for Axis
Blanket Implementations§
source§impl<T> AsAny for Twhere
T: Any,
impl<T> AsAny for Twhere
T: Any,
source§fn as_dyn_any(&self) -> &(dyn Any + 'static)
fn as_dyn_any(&self) -> &(dyn Any + 'static)
Return self.
source§fn as_mut_dyn_any(&mut self) -> &mut (dyn Any + 'static)
fn as_mut_dyn_any(&mut self) -> &mut (dyn Any + 'static)
Return self.
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