pub struct Rect {
pub x: Scalar,
pub y: Scalar,
pub w: Scalar,
pub h: Scalar,
}
Fields§
§x: Scalar
§y: Scalar
§w: Scalar
§h: Scalar
Implementations§
Source§impl Rect
impl Rect
pub fn raw(x: Scalar, y: Scalar, w: Scalar, h: Scalar) -> Self
pub fn new(position: Vec2, size: Vec2) -> Self
pub fn with_size(size: Vec2) -> Self
pub fn bounding(points: &[Vec2]) -> Option<Self>
pub fn align(&self, factor: Vec2) -> Self
pub fn expand(&self, thickness: Scalar) -> Self
pub fn include(&self, point: Vec2) -> Self
pub fn validate(&mut self)
pub fn center(&self) -> Vec2
pub fn size(&self) -> Vec2
pub fn contains_point(&self, point: Vec2) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Rect
impl<'de> Deserialize<'de> for Rect
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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> 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