pub struct Rect { /* private fields */ }Implementations§
Source§impl Rect
impl Rect
pub const ZERO: Self
pub const fn min_max(min: Vec2, max: Vec2) -> Self
pub fn min_size(min: Vec2, size: Vec2) -> Self
pub const fn from_ranges(x_range: Range, y_range: Range) -> Self
pub const fn to_infinity(from: Vec2) -> Self
pub const fn tl(&self) -> Vec2
pub const fn tr(&self) -> Vec2
pub const fn bl(&self) -> Vec2
pub const fn br(&self) -> Vec2
pub const fn left(&self) -> f32
pub const fn right(&self) -> f32
pub const fn top(&self) -> f32
pub const fn bottom(&self) -> f32
pub fn center(&self) -> Vec2
pub fn size(&self) -> Vec2
pub fn width(&self) -> f32
pub fn height(&self) -> f32
pub const fn x_range(&self) -> Range
pub fn set_x_range(&mut self, range: Range)
pub const fn y_range(&self) -> Range
pub fn set_y_range(&mut self, range: Range)
pub const fn axis_range(&self, axis: Axis) -> Range
pub fn set_axis_range(&mut self, axis: Axis, range: Range)
pub fn contains(&self, pt: Vec2) -> bool
pub fn intersect(&self, other: Rect) -> Rect
pub fn shift(&self, offset: Vec2) -> Rect
pub fn grow(&self, margin: Margin) -> Rect
pub fn map(&self, from: Rect, to: Rect) -> Self
pub fn area(&self) -> f32
pub fn left_frac(&self, frac: f32) -> Rect
pub fn right_frac(&self, frac: f32) -> Rect
pub fn top_frac(&self, frac: f32) -> Rect
pub fn bottom_frac(&self, frac: f32) -> Rect
pub fn left_half(&self) -> Rect
pub fn right_half(&self) -> Rect
pub fn top_half(&self) -> Rect
pub fn bottom_half(&self) -> Rect
Trait Implementations§
Source§impl Mul<Rect> for TSTransform
impl Mul<Rect> for TSTransform
impl Copy for Rect
Auto Trait Implementations§
impl Freeze for Rect
impl RefUnwindSafe for Rect
impl Send for Rect
impl Sync for Rect
impl Unpin for Rect
impl UnwindSafe for Rect
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more