pub struct Rect {
pub min: Vec2,
pub max: Vec2,
}
Fields§
§min: Vec2
§max: Vec2
Implementations§
Source§impl Rect
impl Rect
pub const ZERO: Self
pub const fn new(min: Vec2, max: Vec2) -> Self
pub fn min_size(min: Vec2, size: Vec2) -> Self
pub fn center_size(center: Vec2, size: Vec2) -> Self
pub fn round(self) -> Self
pub fn ceil(self) -> Self
pub fn floor(self) -> Self
pub fn size(self) -> Vec2
pub fn width(self) -> f32
pub fn height(self) -> f32
pub fn center(self) -> Vec2
pub fn contains(self, point: Vec2) -> bool
pub fn union(self, other: Self) -> Self
pub fn left(self) -> f32
pub fn right(self) -> f32
pub fn top(self) -> f32
pub fn bottom(self) -> f32
pub fn top_left(self) -> Vec2
pub fn top_right(self) -> Vec2
pub fn bottom_left(self) -> Vec2
pub fn bottom_right(self) -> Vec2
pub fn translate(self, offset: impl Into<Vec2>) -> Self
pub fn pad(self, padding: impl Into<Vec2>) -> Self
Trait Implementations§
impl Copy for Rect
impl StructuralPartialEq 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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.